Files
ansible-automations/site.yml
2024-04-12 19:37:45 +02:00

35 lines
1.1 KiB
YAML

# ===================================================================================================
# ? ABOUT
# @author : Noah Knegt
# @email : personal@noahknegt.com
# @repo : https://git.noahknegt.com/noah.knegt/ansible-automations
# @createdOn : 27-02-2023
# @description : This will apply the base configuration to the list of machines.
# ===================================================================================================
---
- name: Setup
hosts: all
remote_user: root
roles:
- role: setup
when: setup is defined
# Clean up the system
- name: Cleanup
hosts: all
remote_user: ansible
become: true
tasks:
- name: Cleanup package cache (debian and ubuntu)
ansible.builtin.apt:
autoclean: true
changed_when: false
when: ansible_os_family == "Debian"
- name: Autoremove packages (debian and ubuntu)
ansible.builtin.apt:
autoremove: true
purge: true
when: ansible_os_family == "Debian"