Skip to content

Commit f678509

Browse files
authored
Merge pull request #61 from stackhpc/consul-variable-port
Make consul port editable
2 parents 816b19f + 5ec36ae commit f678509

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

roles/vault/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Role variables
2121
* Consul
2222
* Optional
2323
* `consul_bind_interface`: Which interface should be used for Consul (default: "lo")
24+
* `consul_bind_port`: Which port should be used for Consul (default: "8500")
2425
* `consul_docker_name`: Docker - under which name to run the Consul image (default: "consul")
2526
* `consul_docker_image`: Docker image for Consul (default: "hashicorp/consul")
2627
* `consul_docker_tag`: Docker image tag for Consul (default: "latest")

roles/vault/defaults/main.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ vault_config: >
5050
}],
5151
"storage": {
5252
"consul": {
53-
"address": "127.0.0.1:8500",
53+
"address": "127.0.0.1:{{ consul_bind_port }}",
5454
"path": "vault/"
5555
}
5656
},
@@ -62,6 +62,7 @@ vault_config: >
6262
6363
consul_bind_interface: "lo"
6464
consul_bind_ip: "{{ hostvars[inventory_hostname].ansible_facts[consul_bind_interface].ipv4.address }}"
65+
consul_bind_port: "8500"
6566

6667
# Docker options
6768
vault_container: {}

roles/vault/tasks/consul.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
-bind "{{ hostvars[inventory_hostname].ansible_facts[consul_bind_interface].ipv4.address }}"
1818
-data-dir /consul/data
1919
-server
20+
-http-port "{{ consul_bind_port }}"
2021
-bootstrap-expect "{{ ansible_play_hosts | length }}"
2122
{% for host in ansible_play_hosts %}
2223
{% if host != inventory_hostname %}

0 commit comments

Comments
 (0)