diff --git a/ansible.cfg b/ansible.cfg old mode 100644 new mode 100755 index a9ead99..07c2cc1 --- a/ansible.cfg +++ b/ansible.cfg @@ -1,2 +1,3 @@ -[defaults] -inventory=inventory \ No newline at end of file +[defaults] +inventory=inventory +callback_whitelist = profile_tasks \ No newline at end of file diff --git a/inventory b/inventory index 4e9a014..66810be 100644 --- a/inventory +++ b/inventory @@ -1,18 +1,18 @@ - -[rpi:children] -rpi_rpios -rpi_ubuntu - -[rpi_ubuntu] -piprint ansible_host=192.168.2.95 - -[rpi_ubuntu:vars] -ansible_user=ubuntu - -[rpi_rpios] -octopi ansible_host=192.168.2.99 -pihole ansible_host=192.168.2.20 -naspi ansible_host=192.168.2.75 - -[rpi_rpios:vars] + +[rpi:children] +rpi_rpios +rpi_ubuntu + +[rpi_ubuntu] +piprint ansible_host=192.168.2.95 + +[rpi_ubuntu:vars] +ansible_user=ubuntu + +[rpi_rpios] +octopi ansible_host=192.168.2.99 +pihole ansible_host=192.168.2.20 +naspi ansible_host=192.168.2.75 + +[rpi_rpios:vars] ansible_user=pi \ No newline at end of file diff --git a/playbooks/disabled_unattended-upgrades.yml b/playbooks/disabled_unattended-upgrades.yml old mode 100644 new mode 100755 index 8837bfa..7271360 --- a/playbooks/disabled_unattended-upgrades.yml +++ b/playbooks/disabled_unattended-upgrades.yml @@ -1,8 +1,8 @@ -- hosts: rpi - become: yes - tasks: - - name: remove unattended-upgrades - apt: - package: unattended-upgrades - state: absent +- hosts: rpi + become: yes + tasks: + - name: remove unattended-upgrades + apt: + package: unattended-upgrades + state: absent autoremove: yes \ No newline at end of file diff --git a/playbooks/rpi_patches.yml b/playbooks/rpi_patches.yml old mode 100644 new mode 100755 index e0f1283..35b21ce --- a/playbooks/rpi_patches.yml +++ b/playbooks/rpi_patches.yml @@ -1,10 +1,19 @@ -- hosts: rpi - become: yes - tasks: - - name: Apt Update - apt: - update_cache: yes - - - name: Apt Upgrade - apt: - upgrade: safe \ No newline at end of file +- hosts: rpi + become: yes + tasks: + - name: Apt Update + apt: + update_cache: yes + + - name: Apt Upgrade + apt: + upgrade: safe + + - name: Check if reboot required + stat: + path: /var/run/reboot-required + register: reboot_required_file + + - name: Reboot if required + reboot: + when: reboot_required_file.stat.exists == true \ No newline at end of file