From 121b2ff1018f3917cc53b2b526d33a0c80338848 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Wed, 10 Jan 2024 16:19:03 -0600 Subject: [PATCH] wip --- host_vars/nut0.pyrocufflink.blue.yml | 1 + nut.yml | 2 ++ roles/nut/tasks/main.yml | 7 ++++--- 3 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 host_vars/nut0.pyrocufflink.blue.yml diff --git a/host_vars/nut0.pyrocufflink.blue.yml b/host_vars/nut0.pyrocufflink.blue.yml new file mode 100644 index 0000000..0c78839 --- /dev/null +++ b/host_vars/nut0.pyrocufflink.blue.yml @@ -0,0 +1 @@ +host_uses_firewalld: false diff --git a/nut.yml b/nut.yml index 713f84a..b62a8cc 100644 --- a/nut.yml +++ b/nut.yml @@ -1,4 +1,6 @@ - hosts: nut + vars: + path_prefix: '' roles: - role: nut tags: diff --git a/roles/nut/tasks/main.yml b/roles/nut/tasks/main.yml index 38dcde4..3d7df3f 100644 --- a/roles/nut/tasks/main.yml +++ b/roles/nut/tasks/main.yml @@ -8,7 +8,7 @@ - name: ensure upsd is configured template: src: upsd.conf.j2 - dest: /etc/ups/upsd.conf + dest: '{{ path_prefix }}/etc/ups/upsd.conf' owner: root group: nut mode: 'o=rw,g=r,o=' @@ -19,7 +19,7 @@ - name: ensure ups is configured template: src: ups.conf.j2 - dest: /etc/ups/ups.conf + dest: '{{ path_prefix }}/etc/ups/ups.conf' owner: root group: nut mode: 'o=rw,g=r,o=' @@ -30,7 +30,7 @@ - name: ensure upsd users are configured template: src: upsd.users.j2 - dest: /etc/ups/upsd.users + dest: '{{ path_prefix }}/etc/ups/upsd.users' owner: root group: nut mode: 'o=rw,g=r,o=' @@ -58,5 +58,6 @@ state: enabled immediate: true permanent: true + when: host_uses_firewalld|d(true) tags: - firewalld