Files
ansible-automations/site.yml
Noah Knegt 708f0a59f8 Clean up errors
Signed-off-by: Noah Knegt <git@noahknegt.com>
2024-04-11 19:47:38 +02:00

44 lines
1.2 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: datacenter
remote_user: root
roles:
- role: setup
when: setup is defined
- name: Install tools
hosts: datacenter
remote_user: ansible
roles:
- role: docker
- role: nvm
- role: node
- role: corepack
# Clean up the system
- name: Cleanup
hosts: datacenter
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"