Files
ansible-automations/base.yml
2023-02-27 17:43:29 +01:00

33 lines
1001 B
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.
#===================================================================================================
---
- hosts: ubuntu
remote_user: ansible
become: true
roles:
- base
# Clean up the system
- hosts: ubuntu
remote_user: ansible
become: true
tasks:
- name: cleanup package cache (debian and ubuntu)
apt:
autoclean: yes
changed_when: false
when: ansible_os_family == "Debian"
- name: autoremove packages (debian and ubuntu)
apt:
autoremove: yes
purge: yes
when: ansible_os_family == "Debian"