mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-04-16 10:13:26 +02:00
Update to 2022-07-23 14:00
This commit is contained in:
parent
5d2e9f2e70
commit
d44b7ae506
@ -70,6 +70,8 @@ consul_base_conf:
|
|||||||
enabled: "{{ (inventory_hostname in consul_servers) | ternary(True, False) }}"
|
enabled: "{{ (inventory_hostname in consul_servers) | ternary(True, False) }}"
|
||||||
connect:
|
connect:
|
||||||
enabled: "{{ (inventory_hostname in consul_servers) | ternary(True, False) }}"
|
enabled: "{{ (inventory_hostname in consul_servers) | ternary(True, False) }}"
|
||||||
|
performance:
|
||||||
|
raft_multiplier: 1
|
||||||
|
|
||||||
# For example
|
# For example
|
||||||
# consul_extra_conf:
|
# consul_extra_conf:
|
||||||
|
@ -1,6 +1,12 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
- name: Deploy consul configuration
|
- name: Deploy consul configuration
|
||||||
template: src=consul.json.j2 dest={{ consul_root_dir }}/etc/consul.json owner=root group={{ consul_user }} mode=640
|
template:
|
||||||
notify: reload consul
|
src: consul.json.j2
|
||||||
|
dest: "{{ consul_root_dir }}/etc/consul.json"
|
||||||
|
owner: root
|
||||||
|
group: "{{ consul_user }}"
|
||||||
|
mode: 640
|
||||||
|
validate: consul validate %s
|
||||||
|
notify: restart consul
|
||||||
tags: consul
|
tags: consul
|
||||||
|
@ -53,3 +53,9 @@
|
|||||||
when: consul_unit.changed
|
when: consul_unit.changed
|
||||||
tags: consul
|
tags: consul
|
||||||
|
|
||||||
|
- name: Install backup hooks
|
||||||
|
template: src={{ item }}-backup.j2 dest=/etc/backup/{{ item }}.d/consul mode=755
|
||||||
|
loop:
|
||||||
|
- pre
|
||||||
|
- post
|
||||||
|
tags: consul
|
||||||
|
4
roles/consul/templates/post-backup.j2
Normal file
4
roles/consul/templates/post-backup.j2
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -eo pipefail
|
||||||
|
rm -f {{ consul_root_dir }}/backup/consul.snap
|
4
roles/consul/templates/pre-backup.j2
Normal file
4
roles/consul/templates/pre-backup.j2
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -eo pipefail
|
||||||
|
consul snapshot save {{ consul_root_dir }}/backup/consul.snap
|
@ -18,19 +18,21 @@ nomad_user: "{{ nomad_conf.client.enabled | ternary('root', 'nomad') }}"
|
|||||||
nomad_servers: []
|
nomad_servers: []
|
||||||
|
|
||||||
# Ports used by Nomad, the protocols, and the list of IP/CIDR for which the ports will be opened in the firewall
|
# Ports used by Nomad, the protocols, and the list of IP/CIDR for which the ports will be opened in the firewall
|
||||||
nomad_services:
|
nomad_base_services:
|
||||||
http_api:
|
http_api:
|
||||||
port: 4646
|
port: "{{ nomad_conf.ports.http | default(4646) }}"
|
||||||
proto: [tcp]
|
proto: [tcp]
|
||||||
src_ip: []
|
src_ip: []
|
||||||
rpc:
|
rpc:
|
||||||
port: 4647
|
port: "{{ nomad_conf.ports.rpc | default(4647) }}"
|
||||||
proto: [tcp]
|
proto: [tcp]
|
||||||
src_ip: []
|
src_ip: []
|
||||||
serf:
|
serf:
|
||||||
port: 4648
|
port: "{{ nomad_conf.ports.serf | default(4648) }}"
|
||||||
proto: [tcp,udp]
|
proto: [tcp,udp]
|
||||||
src_ip: []
|
src_ip: []
|
||||||
|
nomad_extra_services: {}
|
||||||
|
nomad_services: "{{ nomad_base_services | combine(nomad_extra_services, recursive=True) }}"
|
||||||
|
|
||||||
# Nomad configuration (which will be converted to JSON)
|
# Nomad configuration (which will be converted to JSON)
|
||||||
# The configuration is splited in a base conf, an extra conf, and a host conf so you can override part of the config easily
|
# The configuration is splited in a base conf, an extra conf, and a host conf so you can override part of the config easily
|
||||||
@ -47,10 +49,6 @@ nomad_base_conf:
|
|||||||
server_join:
|
server_join:
|
||||||
retry_join: "{{ (inventory_hostname in nomad_servers) | ternary(nomad_servers, []) }}"
|
retry_join: "{{ (inventory_hostname in nomad_servers) | ternary(nomad_servers, []) }}"
|
||||||
bootstrap_expect: "{{ nomad_servers | length }}"
|
bootstrap_expect: "{{ nomad_servers | length }}"
|
||||||
ports:
|
|
||||||
http: "{{ nomad_services.http_api.port }}"
|
|
||||||
rpc: "{{ nomad_services.rpc.port }}"
|
|
||||||
serf: "{{ nomad_services.serf.port }}"
|
|
||||||
|
|
||||||
# For example
|
# For example
|
||||||
# nomad_extra_conf:
|
# nomad_extra_conf:
|
||||||
|
@ -1,6 +1,12 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
- name: Deploy nomad configuration
|
- name: Deploy nomad configuration
|
||||||
template: src=nomad.json.j2 dest={{ nomad_root_dir }}/etc/nomad.json owner=root group={{ nomad_user }} mode=640
|
template:
|
||||||
|
src: nomad.json.j2
|
||||||
|
dest: "{{ nomad_root_dir }}/etc/nomad.json"
|
||||||
|
owner: root
|
||||||
|
group: "{{ nomad_user }}"
|
||||||
|
mode: 640
|
||||||
|
validate: nomad config validate %s
|
||||||
notify: restart nomad
|
notify: restart nomad
|
||||||
tags: nomad
|
tags: nomad
|
||||||
|
Loading…
x
Reference in New Issue
Block a user