Create playbook and role to install packages

This commit is contained in:
c0de 2024-01-03 23:56:20 -06:00
parent 9056a38e4b
commit 3fb0d66a4a
2 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,14 @@
---
- name: Install Packages
become: true
hosts: pibox
tasks:
- name: Loop over packages_to_install and install them
ansible.builtin.include_role:
name: apt-install-package
loop: packages_to_install
loop_control:
loop_var: package
...

View File

@ -0,0 +1,10 @@
---
- name: "Install {{ package }}"
ansible.builtin.apt:
update_cache: true
name: "{{ package }}"
state: latest
failed_when: package is unset
...