diff --git a/playbooks/nut-server.yaml b/playbooks/nut-server.yaml index 0c18dd3..06ea95b 100644 --- a/playbooks/nut-server.yaml +++ b/playbooks/nut-server.yaml @@ -65,7 +65,7 @@ - name: Download vim config from aperture (root) ansible.builtin.get_url: - dest: /root/.vimrc + dest: ~/.vimrc url: https://aperture.dismyserver.net/.vimrc become: true become_method: sudo @@ -128,19 +128,20 @@ - name: Verify python template is deployed ansible.builtin.template: dest: /home/pi/telegraf-nut-input/input.py - src: /root/ansible/templates/nut-telegraf-input.py.j2 + src: ~/ansible/templates/nut-telegraf-input.py.j2 mode: '0644' - name: Verify telegraf template is deployed ansible.builtin.template: dest: /etc/telegraf/telegraf.d/nut-telegraf.conf mode: '0644' - src: /root/ansible/templates/nut-telegraf.conf.j2 + src: ~/ansible/templates/nut-telegraf.conf.j2 become: true become_method: sudo + register: telegraf_deployed - name: Verify monitoring template is deployed ansible.builtin.template: dest: /home/pi/nutmon.sh - src: /root/ansible/templates/nutmon.sh.j2 + src: ~/ansible/templates/nutmon.sh.j2 mode: '0755' - name: Ensure monitoring script is scheduled @@ -161,6 +162,7 @@ ignore_errors: true become: true become_method: sudo + when: telegraf_deployed.changed - name: Check for OS required reboots ansible.builtin.stat: diff --git a/playbooks/servicetag.yaml b/playbooks/servicetag.yaml index 8640acd..e405597 100644 --- a/playbooks/servicetag.yaml +++ b/playbooks/servicetag.yaml @@ -8,7 +8,7 @@ state: directory - name: Ensure service tag script is present ansible.builtin.copy: - src: /root/ansible/files/servicetag.sh + src: ~/ansible/files/servicetag.sh dest: /opt/ansible/servicetag.sh mode: '0755' force: yes diff --git a/playbooks/smolmonitor.yaml b/playbooks/smolmonitor.yaml index 8ce712a..c71e8f1 100644 --- a/playbooks/smolmonitor.yaml +++ b/playbooks/smolmonitor.yaml @@ -21,7 +21,7 @@ become_method: sudo - name: Download vim config from aperture (root) ansible.builtin.get_url: - dest: /root/.vimrc + dest: ~/.vimrc url: https://aperture.dismyserver.net/.vimrc become: true become_method: sudo @@ -36,7 +36,7 @@ - name: Verify certificate script is deployed ansible.builtin.template: dest: /opt/sublight/scripts/collect-certdata.sh - src: /root/ansible/templates/collect-certdata.sh.j2 + src: ~/ansible/templates/collect-certdata.sh.j2 mode: '0744' - name: Ensure cert monitoring script is scheduled ansible.builtin.cron: