ansible-roles/evolinux-base/tasks/packages.yml

150 lines
3.2 KiB
YAML

---
- name: Install/Update system tools
apt:
name:
- locales
- sudo
- ntpdate
- lsb-release
- dnsutils
- pv
- apg
- conntrack
- logrotate
- bash-completion
- ssl-cert
- ca-certificates
- rename
- dmidecode
when: evolinux_packages_system | bool
- name: Install/Update diagnostic tools
apt:
name:
- strace
- htop
- iftop
- iptraf
- ncdu
- iotop
- tcpdump
- mtr-tiny
- curl
- wget
- telnet
- traceroute
- man
- molly-guard
when: evolinux_packages_diagnostic | bool
- name: Install/Update hardware tools
apt:
name:
- hdparm
- smartmontools
- lm-sensors
when: ansible_virtualization_role == "host"
- name: Install/Update common tools
apt:
name:
- vim
- screen
- tmux
- mutt
- tree
- git
- rsync
- bc
- pinentry-curses
- ncurses-term
when: evolinux_packages_common | bool
- name: Be sure that openntpd package is absent/purged
apt:
name: openntpd
state: absent
purge: True
when: evolinux_packages_purge_openntpd | bool
- name: the chrony package is absent
apt:
name: chrony
purge: True
state: absent
when: evolinux_packages_purge_chrony | bool
- name: Be sure locate/mlocate is absent/purged
apt:
name:
- locate
- mlocate
state: absent
purge: yes
when: evolinux_packages_purge_locate | bool
- name: Install/Update serveur-base meta-package
apt:
name: serveur-base
allow_unauthenticated: yes
when: evolinux_packages_serveur_base | bool
- name: Install/Update packages for Stretch and later
apt:
name: net-tools
when:
- evolinux_packages_stretch | bool
- ansible_distribution_major_version is version('9', '>=')
- name: Install/Update packages for Buster and later
apt:
name:
- spectre-meltdown-checker
- binutils
when:
- evolinux_packages_buster | bool
- ansible_distribution_major_version is version('10', '>=')
- name: Customize logcheck recipient
lineinfile:
dest: /etc/logcheck/logcheck.conf
regexp: '^SENDMAILTO=".*"$'
line: 'SENDMAILTO="{{ logcheck_alert_email or general_alert_email | mandatory }}"'
when: evolinux_packages_logcheck_recipient | bool
- name: Deleting rpcbind and nfs-common
apt:
name:
- rpcbind
- nfs-common
state: absent
when: evolinux_packages_delete_nfs | bool
# TODO: use ini_file when Ansible > 2.1 (no_extra_spaces: yes)
- name: Configure Listchanges on Jessie
lineinfile:
dest: /etc/apt/listchanges.conf
regexp: '^{{ item.option }}\s*='
line: "{{ item.option }}={{ item.value }}"
loop:
- { option: "confirm", value: "1" }
- { option: "which", value: "both" }
when:
- evolinux_packages_listchanges | bool
- ansible_distribution == "Debian"
- ansible_distribution_release == "jessie"
- name: apt-listchanges is absent on Stretch and later
apt:
name: apt-listchanges
state: absent
when:
- ansible_distribution == "Debian"
- ansible_distribution_major_version is version('9', '>=')
- evolinux_packages_delete_aptlistchanges
- meta: flush_handlers