diff --git a/changelogs/fragments/58692-consul_session_dont_ignore_scheme_parameter.yml b/changelogs/fragments/58692-consul_session_dont_ignore_scheme_parameter.yml new file mode 100644 index 00000000000..991fcbf279f --- /dev/null +++ b/changelogs/fragments/58692-consul_session_dont_ignore_scheme_parameter.yml @@ -0,0 +1,2 @@ +bugfixes: + - "consul_session: don't ignore ``scheme`` parameter" diff --git a/lib/ansible/modules/clustering/consul_session.py b/lib/ansible/modules/clustering/consul_session.py index aa916af9c59..c6911a4596a 100644 --- a/lib/ansible/modules/clustering/consul_session.py +++ b/lib/ansible/modules/clustering/consul_session.py @@ -232,7 +232,8 @@ def remove_session(module): def get_consul_api(module): return consul.Consul(host=module.params.get('host'), - port=module.params.get('port')) + port=module.params.get('port'), + scheme=module.params.get('scheme')) def test_dependencies(module): diff --git a/test/integration/targets/consul/tasks/consul_session.yml b/test/integration/targets/consul/tasks/consul_session.yml index 6763b0ad181..f50fe0f7af6 100644 --- a/test/integration/targets/consul/tasks/consul_session.yml +++ b/test/integration/targets/consul/tasks/consul_session.yml @@ -70,6 +70,18 @@ that: - result is failed +- name: ensure unknown scheme fails + consul_session: + state: info + id: '{{ session_id }}' + scheme: non_existent + register: result + ignore_errors: True + +- assert: + that: + - result is failed + - name: delete a session consul_session: state: absent