Added consul playbook and handler
This commit is contained in:
parent
62ba932e06
commit
df9e133e0a
3 changed files with 38 additions and 1 deletions
|
@ -26,7 +26,7 @@ description: DebOps HashiCorp Collection
|
|||
# Either a single license or a list of licenses for content inside of a collection. Ansible Galaxy currently only
|
||||
# accepts L(SPDX,https://spdx.org/licenses/) licenses. This key is mutually exclusive with 'license_file'
|
||||
license:
|
||||
- GPL-2.0-or-later
|
||||
- GPL-3.0-or-later
|
||||
|
||||
# The path to the license file for the collection. This path is relative to the root of the collection. This key is
|
||||
# mutually exclusive with 'license'
|
||||
|
|
31
playbooks/consul.yml
Normal file
31
playbooks/consul.yml
Normal file
|
@ -0,0 +1,31 @@
|
|||
---
|
||||
- name: Manage Consul Servers
|
||||
hosts: debops_service_consul_servers
|
||||
tags: ['role::consul', 'role::consul:server', 'skip::consul' ]
|
||||
serial: 1
|
||||
become: True
|
||||
|
||||
environment: '{{ inventory__environment | d({})
|
||||
| combine(inventory__group_environment | d({}))
|
||||
| combine(inventory__host_environment | d({})) }}'
|
||||
|
||||
roles:
|
||||
- role: consul
|
||||
tags: [ 'role::consul', 'skip::consul' ]
|
||||
|
||||
- name: Manage Consul Agents
|
||||
hosts: [ 'all', '!debops_service_consul_servers' ]
|
||||
tags: [ 'role::consul', 'role::consul:agent', 'skip::consul' ]
|
||||
serial:
|
||||
- 1
|
||||
- 3
|
||||
- 5
|
||||
become: True
|
||||
|
||||
environment: '{{ inventory__environment | d({})
|
||||
| combine(inventory__group_environment | d({}))
|
||||
| combine(inventory__host_environment | d({})) }}'
|
||||
|
||||
roles:
|
||||
- role: consul
|
||||
tags: [ 'role::consul', 'skip::consul' ]
|
6
roles/consul/handlers/main.yml
Normal file
6
roles/consul/handlers/main.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
- name: Restart consul
|
||||
service:
|
||||
name: consul
|
||||
state: restarted
|
||||
when: manage_consul_service | default(False)
|
Loading…
Reference in a new issue