diff --git a/all.yml b/all.yml new file mode 100644 index 0000000..3d14478 --- /dev/null +++ b/all.yml @@ -0,0 +1,38 @@ +--- +# tasks for all hosts + +- hosts: all + become: true + + vars: + ansible_python_interpreter: /usr/bin/python3 + + roles: + - role: ansible.timezone + + tasks: + - name: Update and clean package cache + apt: + update_cache: true + cache_valid_time: 3600 + autoclean: true + changed_when: false + + - name: Ensure unattended-upgrades is installed and up to date + apt: + name: unattended-upgrades + state: present + + - name: Setup unattended-upgrades + include_role: + name: ansible-role-unattended-upgrades + vars: + unattended_origins_patterns: + - "origin=Debian,archive=buster-security" + - "o=Debian,a=buster-updates" + unattended_package_blacklist: [cowsay] + unattended_mail: "root" + + - name: Setup users + include_role: + name: users diff --git a/main.yml b/main.yml index 88c86ef..797b943 100644 --- a/main.yml +++ b/main.yml @@ -1,39 +1,8 @@ --- -- hosts: all - become: true +# main playbook aggregating all the other playbooks - vars: - ansible_python_interpreter: /usr/bin/python3 - - roles: - - role: ansible.timezone - - tasks: - - name: Update and clean package cache - apt: - update_cache: true - cache_valid_time: 3600 - autoclean: true - changed_when: false - - - name: Ensure unattended-upgrades is installed and up to date - apt: - name: unattended-upgrades - state: present - - - name: Setup unattended-upgrades - include_role: - name: ansible-role-unattended-upgrades - vars: - unattended_origins_patterns: - - "origin=Debian,archive=buster-security" - - "o=Debian,a=buster-updates" - unattended_package_blacklist: [cowsay] - unattended_mail: "root" - - - name: Setup users - include_role: - name: users +- name: Setup for all hosts + import_playbook: all.yml - name: Specific setup for all proxmox hosts import_playbook: proxmox.yml