From 9af9c9f8c008b1c0e6c8779b75cccf8990f0ed8c Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Mon, 15 Jul 2024 22:10:36 +0200 Subject: add minimalistc redis-server role --- chaos-at-home/ch-testvm-prometheus.yml | 1 + inventory/host_vars/ch-testvm-prometheus.yml | 3 +++ roles/redis/server/defaults/main.yml | 2 ++ roles/redis/server/handlers/main.yml | 5 +++++ roles/redis/server/tasks/main.yml | 14 ++++++++++++++ 5 files changed, 25 insertions(+) create mode 100644 roles/redis/server/defaults/main.yml create mode 100644 roles/redis/server/handlers/main.yml create mode 100644 roles/redis/server/tasks/main.yml diff --git a/chaos-at-home/ch-testvm-prometheus.yml b/chaos-at-home/ch-testvm-prometheus.yml index aa71d2c3..edd278ea 100644 --- a/chaos-at-home/ch-testvm-prometheus.yml +++ b/chaos-at-home/ch-testvm-prometheus.yml @@ -13,6 +13,7 @@ roles: - role: x509/static-ca/base - role: nginx/base + - role: redis/server - role: mail/opendkim - role: mail/rspamd - role: mail/postfix/base diff --git a/inventory/host_vars/ch-testvm-prometheus.yml b/inventory/host_vars/ch-testvm-prometheus.yml index 7355322d..147e0fe3 100644 --- a/inventory/host_vars/ch-testvm-prometheus.yml +++ b/inventory/host_vars/ch-testvm-prometheus.yml @@ -41,6 +41,9 @@ sshd_allowusers_host: "{{ normal_users_host | union(admin_users_host) | union([' ## test +redis_server_legacy_auth_password: "changeme" + + opendkim_admin_mail: postmaster@chaox.org opendkim_internal_hosts: - 127.0.0.1 diff --git a/roles/redis/server/defaults/main.yml b/roles/redis/server/defaults/main.yml new file mode 100644 index 00000000..b67716c7 --- /dev/null +++ b/roles/redis/server/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# redis_server_legacy_auth_password: "very-secret" diff --git a/roles/redis/server/handlers/main.yml b/roles/redis/server/handlers/main.yml new file mode 100644 index 00000000..d0271f7f --- /dev/null +++ b/roles/redis/server/handlers/main.yml @@ -0,0 +1,5 @@ +--- +- name: restart redis-server + service: + name: redis-server + state: restarted diff --git a/roles/redis/server/tasks/main.yml b/roles/redis/server/tasks/main.yml new file mode 100644 index 00000000..8114bced --- /dev/null +++ b/roles/redis/server/tasks/main.yml @@ -0,0 +1,14 @@ +--- +- name: install redis-server packages + apt: + name: + - redis-server + state: present + +- name: configure legacy authentication password + when: redis_server_legacy_auth_password is defined + lineinfile: + regexp: '^#?\s*requirepass\s' + line: requirepass {{ redis_server_legacy_auth_password }} + path: /etc/redis/redis.conf + notify: restart redis-server -- cgit v1.2.3