diff --git a/clustering/consul.py b/clustering/consul.py index 627f7fb66af..f0df2368b51 100644 --- a/clustering/consul.py +++ b/clustering/consul.py @@ -71,6 +71,18 @@ options: - the port on which the consul agent is running required: false default: 8500 + scheme: + description: + - the protocol scheme on which the consul agent is running + required: false + default: http + version_added: "2.1" + validate_certs: + description: + - whether to verify the tls certificate of the consul agent + required: false + default: True + version_added: "2.1" notes: description: - Notes to attach to check when registering it. @@ -308,6 +320,8 @@ def remove_service(module, service_id): def get_consul_api(module, token=None): return consul.Consul(host=module.params.get('host'), port=module.params.get('port'), + scheme=module.params.get('scheme'), + validate_certs=module.params.get('validate_certs'), token=module.params.get('token')) @@ -503,6 +517,8 @@ def main(): argument_spec=dict( host=dict(default='localhost'), port=dict(default=8500, type='int'), + scheme=dict(required=False, default='http'), + validate_certs=dict(required=False, default=True, type='bool'), check_id=dict(required=False), check_name=dict(required=False), check_node=dict(required=False), diff --git a/clustering/consul_acl.py b/clustering/consul_acl.py index 17d59ea62a8..b1c7763a550 100644 --- a/clustering/consul_acl.py +++ b/clustering/consul_acl.py @@ -69,6 +69,18 @@ options: - the port on which the consul agent is running required: false default: 8500 + scheme: + description: + - the protocol scheme on which the consul agent is running + required: false + default: http + version_added: "2.1" + validate_certs: + description: + - whether to verify the tls certificate of the consul agent + required: false + default: True + version_added: "2.1" """ EXAMPLES = ''' @@ -300,6 +312,8 @@ def get_consul_api(module, token=None): token = module.params.get('token') return consul.Consul(host=module.params.get('host'), port=module.params.get('port'), + scheme=module.params.get('scheme'), + validate_certs=module.params.get('validate_certs'), token=token) def test_dependencies(module): @@ -315,6 +329,8 @@ def main(): argument_spec = dict( mgmt_token=dict(required=True, no_log=True), host=dict(default='localhost'), + scheme=dict(required=False, default='http'), + validate_certs=dict(required=False, default=True), name=dict(required=False), port=dict(default=8500, type='int'), rules=dict(default=None, required=False, type='list'), diff --git a/clustering/consul_kv.py b/clustering/consul_kv.py index b61c0ee1841..9358b79749a 100644 --- a/clustering/consul_kv.py +++ b/clustering/consul_kv.py @@ -99,6 +99,18 @@ options: - the port on which the consul agent is running required: false default: 8500 + scheme: + description: + - the protocol scheme on which the consul agent is running + required: false + default: http + version_added: "2.1" + validate_certs: + description: + - whether to verify the tls certificate of the consul agent + required: false + default: True + version_added: "2.1" """ @@ -218,6 +230,8 @@ def remove_value(module): def get_consul_api(module, token=None): return consul.Consul(host=module.params.get('host'), port=module.params.get('port'), + scheme=module.params.get('scheme'), + validate_certs=module.params.get('validate_certs'), token=module.params.get('token')) def test_dependencies(module): @@ -232,6 +246,8 @@ def main(): flags=dict(required=False), key=dict(required=True), host=dict(default='localhost'), + scheme=dict(required=False, default='http'), + validate_certs=dict(required=False, default=True), port=dict(default=8500, type='int'), recurse=dict(required=False, type='bool'), retrieve=dict(required=False, default=True), diff --git a/clustering/consul_session.py b/clustering/consul_session.py index 663456daf80..f0ebd11b3b4 100644 --- a/clustering/consul_session.py +++ b/clustering/consul_session.py @@ -88,6 +88,18 @@ options: - the port on which the consul agent is running required: false default: 8500 + scheme: + description: + - the protocol scheme on which the consul agent is running + required: false + default: http + version_added: "2.1" + validate_certs: + description: + - whether to verify the tls certificate of the consul agent + required: false + default: True + version_added: "2.1" """ EXAMPLES = ''' @@ -239,6 +251,8 @@ def main(): delay=dict(required=False,type='str', default='15s'), host=dict(default='localhost'), port=dict(default=8500, type='int'), + scheme=dict(required=False, default='http'), + validate_certs=dict(required=False, default=True), id=dict(required=False), name=dict(required=False), node=dict(required=False),