Ansible role for managing Debian system packages:
- install
- update
- update security
- clean
- remove
Only tested with ansible 2.9.6 min version
Available variables are listed below, along with default values vars/main.yml
and defaults/main.yml
Other way is define those variable in your group hosts or host vars.
# Install
# List the packages that should be installed here, one per line. Be sure to remove the '[]'
base_system_packages_install:
- doscan
- ncat
- nmap
# Remove
# List the packages that should be removed here, one per line. Be sure to remove the '[]'
base_system_packages_remove:
- build-essential
- gcc-4.8
- make
# Update
# List the packages that should be update here, one per line. Be sure to remove the '[]'
base_system_packages_update: []
No dependencies
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
- hosts: servers
roles:
- { role: isweluiz.ansible-package-manage }
Remember to use tags based on your needs, otherwise we have the tag never
with this the task will not run.
- install
- update
- security
- clean
- remove
ansible-playbook playbooks/ansible-package.yml -i hosts -l local -t install
ansible-playbook playbooks/ansible-package.yml -i hosts -l local -t update
ansible-playbook playbooks/ansible-package.yml -i hosts -l local -t security
ansible-playbook playbooks/ansible-package.yml -i hosts -l local -t clean
ansible-playbook playbooks/ansible-package.yml -i hosts -l local -t remove
MIT