This ansible role manage linux packages.
It can be used for :
- install and remove packages
- check for update
- upgrades packages
- download upgrades
- clean cache
- autoremove
Platform | Versions |
---|---|
Debian | all |
EL | all |
Fedora | all |
Ubuntu | all |
Ansible >= 2.13
None.
ansible-galaxy install dginhoux.packages
git clone https://github.com/dginhoux/ansible_role.packages dginhoux.packages
- name: Playbook
hosts: all
tasks:
- name: Start role dginhoux.packages to setup "packages_list, packages_list_host and packages_list_group".
vars:
packages_action: setup
ansible.builtin.include_role:
name: dginhoux.packages
- name: Playbook
hosts: all
tasks:
- name: Start role dginhoux.packages to check for availables upgrades
vars:
packages_action: check
ansible.builtin.include_role:
name: dginhoux.packages
Defaults variables defined in defaults/main.yml
# packages_action: upgrade
packages_action: check
# packages_action: autoremove
# packages_action: clean
# packages_action: setup
# packages_action: download
packages_list:
- { name: fio, state: present }
- { name: git, state: present }
- { name: gitui, state: present, apt_ignore: yes }
- { name: gpg, state: present }
- { name: htop, state: present }
- { name: haveged, state: present }
- { name: hwinfo, state: present }
- { name: iftop, state: present }
# - { name: ifupdown2, apt: ifupdown2, dnf_ignore: yes, yum_ignore: yes }
- { name: iotop, state: present }
- { name: jq, state: present }
- { name: lshw, state: present }
- { name: lynx, state: present }
- { name: lvm2, state: present }
- { name: nfs, state: present, apt: nfs-common, dnf: nfs-utils, yum: nfs-utils }
- { name: ngrep, state: present }
- { name: nmon, state: present }
- { name: nmap, state: present }
- { name: oathtool, state: present }
- { name: parted, state: present }
- { name: python-apt, state: present, apt: python-apt, dnf_ignore: yes, yum_ignore: yes }
- { name: python3-pip, state: present }
- { name: python3-virtualenv, state: present }
- { name: rsync, state: present }
- { name: screen, state: present }
- { name: scdaemon, state: present, dnf_ignore: yes, yum_ignore: yes }
- { name: sshpass, state: present }
- { name: sudo, state: present }
- { name: sysstat, state: present }
- { name: tig, state: present }
- { name: tmux, state: present }
- { name: tree, state: present }
- { name: unzip, state: present }
- { name: vim, state: present }
- { name: yamllint, state: present }
- { name: wget, state: present }
packages_list_host: []
packages_list_group: []
NOTE : Theses 3 lists packages_list
, packages_list_group
and packages_list_host
are merged.
You can use the _host
and _group
lists to specify per host and/or per group content.
Those variables files are located in vars/*.yml
are used to handle OS differences.
One of theses is loaded dynamically during role runtime using the include_vars
module and set OS specifics variable's.
NOT USED BY THIS ROLE
Dany GINHOUX - https://github.com/dginhoux
MIT