Templatizing consul config
This commit is contained in:
parent
603559b255
commit
79e6698db1
@ -1,10 +0,0 @@
|
|||||||
bind_addr = "192.168.1.100"
|
|
||||||
advertise_addr = "192.168.1.100"
|
|
||||||
client_addr = "192.168.1.100"
|
|
||||||
server = true
|
|
||||||
data_dir = "/opt/consul"
|
|
||||||
|
|
||||||
ui_config {
|
|
||||||
enabled = true
|
|
||||||
}
|
|
||||||
|
|
@ -36,7 +36,9 @@
|
|||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
pkg: nomad
|
pkg: nomad
|
||||||
- name: Copy in the consul configuration
|
- name: Copy in the consul configuration
|
||||||
ansible.builtin.copy:
|
vars:
|
||||||
|
ip: "{{ ansible_default_ipv4['address'] }}"
|
||||||
|
ansible.builtin.template:
|
||||||
src: consul.hcl
|
src: consul.hcl
|
||||||
dest: /etc/consul.d/consul.hcl
|
dest: /etc/consul.d/consul.hcl
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
|
10
ansible/roles/local-server-head/templates/consul.hcl
Normal file
10
ansible/roles/local-server-head/templates/consul.hcl
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
bind_addr = "{{ ip }}"
|
||||||
|
advertise_addr = "{{ ip }}"
|
||||||
|
client_addr = "{{ ip }}"
|
||||||
|
server = true
|
||||||
|
data_dir = "/opt/consul"
|
||||||
|
|
||||||
|
ui_config {
|
||||||
|
enabled = true
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user