summaryrefslogtreecommitdiff
path: root/clustering/consul.py
diff options
context:
space:
mode:
authorJoel Thompson <jathomps08@gmail.com>2016-06-19 11:58:44 -0400
committerRené Moser <mail@renemoser.net>2016-06-19 17:58:44 +0200
commit800da3ae16a7bc360f5c8c64421a323813d6d298 (patch)
tree01fd242507f7be2b5503457da6348d1645f4e549 /clustering/consul.py
parent6cb682938451826abe5357e7924a76b0d2c493a0 (diff)
downloadansible-modules-extras-800da3ae16a7bc360f5c8c64421a323813d6d298.tar.gz
Fix default service_address in consul module (#2454)
PR #1299 introduced the service_address parameter but specified a default value of localhost. This is a breaking change; prior to that, the consul module would always assume that the service should advertise the address that the Consul agent was listening on. With this change, the consul module will now default to advertising localhost to all nodes for the service, which isn't the desired behavior. This changes the default back to None which is the implicit default prior to #1299.
Diffstat (limited to 'clustering/consul.py')
-rw-r--r--clustering/consul.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/clustering/consul.py b/clustering/consul.py
index 27c3e842..a5e4a514 100644
--- a/clustering/consul.py
+++ b/clustering/consul.py
@@ -95,10 +95,12 @@ options:
required: false
service_address:
description:
- - the address on which the service is serving required for
- registration of a service
+ - the address to advertise that the service will be listening on.
+ This value will be passed as the I(Address) parameter to Consul's
+ U(/v1/agent/service/register) API method, so refer to the Consul API
+ documentation for further details.
required: false
- default: localhost
+ default: None
version_added: "2.1"
tags:
description:
@@ -185,11 +187,11 @@ EXAMPLES = '''
interval: 60s
http: /status
- - name: register nginx with address
+ - name: register external service nginx available at 10.1.5.23
consul:
service_name: nginx
service_port: 80
- service_address: 127.0.0.1
+ service_address: 10.1.5.23
- name: register nginx with some service tags
consul:
@@ -542,7 +544,7 @@ def main():
script=dict(required=False),
service_id=dict(required=False),
service_name=dict(required=False),
- service_address=dict(required=False, type='str', default='localhost'),
+ service_address=dict(required=False, type='str', default=None),
service_port=dict(required=False, type='int'),
state=dict(default='present', choices=['present', 'absent']),
interval=dict(required=False, type='str'),