diff --git a/galaxy.yml b/galaxy.yml index 9c0d498..70fc05d 100644 --- a/galaxy.yml +++ b/galaxy.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' diff --git a/playbooks/consul.yml b/playbooks/consul.yml new file mode 100644 index 0000000..9510e6e --- /dev/null +++ b/playbooks/consul.yml @@ -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' ] diff --git a/roles/consul/handlers/main.yml b/roles/consul/handlers/main.yml new file mode 100644 index 0000000..bdc9520 --- /dev/null +++ b/roles/consul/handlers/main.yml @@ -0,0 +1,6 @@ +--- +- name: Restart consul + service: + name: consul + state: restarted + when: manage_consul_service | default(False)