aboutsummaryrefslogtreecommitdiffstats
path: root/fdio.infra.ansible/roles/consul
diff options
context:
space:
mode:
Diffstat (limited to 'fdio.infra.ansible/roles/consul')
-rw-r--r--fdio.infra.ansible/roles/consul/defaults/main.yaml2
-rw-r--r--fdio.infra.ansible/roles/consul/handlers/main.yaml4
-rw-r--r--fdio.infra.ansible/roles/consul/meta/main.yaml6
-rw-r--r--fdio.infra.ansible/roles/consul/tasks/main.yaml19
4 files changed, 18 insertions, 13 deletions
diff --git a/fdio.infra.ansible/roles/consul/defaults/main.yaml b/fdio.infra.ansible/roles/consul/defaults/main.yaml
index 13bba8b144..503857de92 100644
--- a/fdio.infra.ansible/roles/consul/defaults/main.yaml
+++ b/fdio.infra.ansible/roles/consul/defaults/main.yaml
@@ -24,7 +24,7 @@ consul_architecture_map:
32-bit: "386"
64-bit: "amd64"
consul_architecture: "{{ consul_architecture_map[ansible_architecture] }}"
-consul_version: "1.9.5"
+consul_version: "1.12.2"
consul_pkg: "consul_{{ consul_version }}_linux_{{ consul_architecture }}.zip"
consul_zip_url: "https://releases.hashicorp.com/consul/{{ consul_version }}/{{ consul_pkg }}"
consul_force_update: false
diff --git a/fdio.infra.ansible/roles/consul/handlers/main.yaml b/fdio.infra.ansible/roles/consul/handlers/main.yaml
index d0e0c598a9..a88ae45d27 100644
--- a/fdio.infra.ansible/roles/consul/handlers/main.yaml
+++ b/fdio.infra.ansible/roles/consul/handlers/main.yaml
@@ -2,14 +2,14 @@
# file roles/consul/handlers/main.yaml
- name: Restart Nomad
- systemd:
+ ansible.builtin.systemd:
daemon_reload: true
enabled: true
name: "nomad"
state: "{{ nomad_restart_handler_state }}"
- name: Restart Consul
- systemd:
+ ansible.builtin.systemd:
daemon_reload: true
enabled: true
name: "consul"
diff --git a/fdio.infra.ansible/roles/consul/meta/main.yaml b/fdio.infra.ansible/roles/consul/meta/main.yaml
index c848f67c7b..bc6d6a1c57 100644
--- a/fdio.infra.ansible/roles/consul/meta/main.yaml
+++ b/fdio.infra.ansible/roles/consul/meta/main.yaml
@@ -1,11 +1,6 @@
---
# file: roles/consul/meta/main.yaml
-# desc: Install consul from stable branch and configure service.
-# inst: Consul
-# conf: ?
-# info: 1.0 - added role
-
dependencies: []
galaxy_info:
role_name: consul
@@ -18,5 +13,6 @@ galaxy_info:
- name: Ubuntu
versions:
- focal
+ - jammy
galaxy_tags:
- consul
diff --git a/fdio.infra.ansible/roles/consul/tasks/main.yaml b/fdio.infra.ansible/roles/consul/tasks/main.yaml
index 4e229714b7..1d6bcc0b0b 100644
--- a/fdio.infra.ansible/roles/consul/tasks/main.yaml
+++ b/fdio.infra.ansible/roles/consul/tasks/main.yaml
@@ -1,14 +1,22 @@
---
# file: roles/consul/tasks/main.yaml
-- name: Install Dependencies
+- name: Inst - Update Repositories Cache
+ apt:
+ update_cache: true
+ when:
+ - ansible_os_family == 'Debian'
+ tags:
+ - consul-inst-package
+
+- name: Inst - Dependencies
apt:
name: "{{ packages | flatten(levels=1) }}"
state: "present"
cache_valid_time: 3600
install_recommends: false
when:
- - ansible_distribution|lower == 'ubuntu'
+ - ansible_os_family == 'Debian'
tags:
- consul-inst-dependencies
@@ -155,7 +163,7 @@
name: "systemd-resolved"
state: "{{ systemd_resolved_state }}"
when:
- - nomad_service_mgr == "systemd"
+ - consul_service_mgr == "systemd"
tags:
- consul-conf
@@ -170,8 +178,9 @@
- "Restart Consul"
- "Restart Nomad"
when:
- - nomad_service_mgr == "systemd"
+ - consul_service_mgr == "systemd"
tags:
- consul-conf
-- meta: flush_handlers
+- name: Meta - Flush handlers
+ meta: flush_handlers