Manage `unattended-upgrades`.
This commit is contained in:
parent
fa17ca5b94
commit
71fd085504
|
@ -11,3 +11,4 @@
|
|||
* Ensure to never remove some packages pattern.
|
||||
* Manage general, periodic and dpkg config files.
|
||||
* Purge default configuration files sets by others apps.
|
||||
* Manage `unattended-upgrades`.
|
||||
|
|
|
@ -34,6 +34,7 @@ Manage APT repos, preferences and configuration for IPR's servers.
|
|||
* **apt_old_pkg_list** : The list of totally useless packages for a production server [default [see below](#tools)].
|
||||
* **apt_old_pkg_state** : State of old packages [default : `absent`].
|
||||
* **apt_old_pkg_manage** : If those old packages should be managed by the role [default : `true`].
|
||||
* **apt_unattended_upgrades** : If `unattended-upgrades` should be managed by the role [default : `yes`].
|
||||
|
||||
## Example Playbook
|
||||
|
||||
|
@ -71,6 +72,7 @@ Manage Debian's sources.list :
|
|||
- Ensure to remove really useless packages from a default installation :
|
||||
* laptop-detect (if a server is a laptop…)
|
||||
* tasksel (simple interface)
|
||||
- Manage `unattended-upgrades`.
|
||||
|
||||
## Development
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
---
|
||||
# defaults file for apt
|
||||
|
||||
# configuration
|
||||
apt_conf_update_pkg_lists: 1
|
||||
apt_conf_download_upgradeable_pkg: 1
|
||||
apt_conf_auto_clean_interval: 0
|
||||
|
@ -11,14 +12,17 @@ apt_conf_purge_list:
|
|||
- 70debconf
|
||||
apt_conf_purge_manage: true
|
||||
|
||||
# repositories
|
||||
apt_src_list_manage: true
|
||||
apt_purge_src_list_file: true
|
||||
|
||||
apt_stretch_manage: true
|
||||
|
||||
# preferences
|
||||
apt_default_pref_path: '/etc/apt/preferences.d/default.pref'
|
||||
apt_default_pref_tpl: 'etc/apt/preferences.d/default.pref.j2'
|
||||
|
||||
# packages
|
||||
apt_tools_list:
|
||||
- aptitude
|
||||
apt_tools_state: 'installed'
|
||||
|
@ -28,3 +32,6 @@ apt_old_pkg_list:
|
|||
- tasksel
|
||||
apt_old_pkg_state: 'absent'
|
||||
apt_old_pkg_manage: true
|
||||
|
||||
# unattended-upgrades
|
||||
apt_unattended_upgrades: yes
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# tasks file for packages
|
||||
|
||||
# Packages
|
||||
- name: Ensure useful tools packages
|
||||
- name: INSTALL useful tools packages
|
||||
apt:
|
||||
name: '{{ item }}'
|
||||
state: '{{ apt_tools_state }}'
|
||||
|
@ -10,7 +10,13 @@
|
|||
- '{{ apt_tools_list }}'
|
||||
when: apt_tools_manage
|
||||
|
||||
- name: Ensure to purge useless packages
|
||||
- name: INSTALL unattended-upgrades
|
||||
apt:
|
||||
pkg: "unattended-upgrades"
|
||||
state: "{{ 'latest' if apt_unattended_upgrades else 'absent' }}"
|
||||
when: apt_unattended_upgrades
|
||||
|
||||
- name: INSTALL purge useless packages
|
||||
apt:
|
||||
name: '{{ item }}'
|
||||
state: '{{ apt_old_pkg_state }}'
|
||||
|
|
Reference in New Issue