Added consul playbook and handler

master
Eric Renfro 9 months ago
parent 62ba932e06
commit df9e133e0a
Signed by: psi-jack
GPG Key ID: 14977F3A50D9A5BF
  1. 2
      galaxy.yml
  2. 31
      playbooks/consul.yml
  3. 6
      roles/consul/handlers/main.yml

@ -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'

@ -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' ]

@ -0,0 +1,6 @@
---
- name: Restart consul
service:
name: consul
state: restarted
when: manage_consul_service | default(False)
Loading…
Cancel
Save