cellinfo
/
ansible.apt
Archived
2
0
Fork 0

Manage periodic config file.

This commit is contained in:
Jeremy Gardais 2017-08-17 17:17:11 +02:00
parent 01933baac4
commit f1d5aa578b
6 changed files with 41 additions and 1 deletions

View File

@ -8,3 +8,4 @@
* Manage default preferences file. * Manage default preferences file.
* Ensure to install some additionnals tools (aptitude,…). * Ensure to install some additionnals tools (aptitude,…).
* Ensure to remove really useless packages (laptop-detect, tasksel,…). * Ensure to remove really useless packages (laptop-detect, tasksel,…).
* Manage periodic config file.

View File

@ -4,6 +4,7 @@
2. [Role Variables](#role-variables) 2. [Role Variables](#role-variables)
3. [Example Playbook](#example-playbook) 3. [Example Playbook](#example-playbook)
4. [Configuration](#configuration) 4. [Configuration](#configuration)
* [APT Configuration](#apt-configuration)
* [Sources List](#sources-list) * [Sources List](#sources-list)
* [Preferences](#preferences) * [Preferences](#preferences)
* [Tools](#tools) * [Tools](#tools)
@ -17,6 +18,9 @@ Manage APT repos, preferences and configuration for IPR's servers.
## Role Variables ## Role Variables
* **apt_conf_update_pkg_lists**: Period of automatic repositories update in days [default: `1`].
* **apt_conf_download_upgradeable_pkg**: Period of automatic download of upgradeable packages in days [default: `1`].
* **apt_conf_auto_clean_interval**: Period of automatic clean of no longer available packages [default: `0`].
* **apt_src_list_manage**: If apt sources list files should be managed [default: `true`]. * **apt_src_list_manage**: If apt sources list files should be managed [default: `true`].
* **apt_purge_src_list_file**: If the default sources.file must be absent [default: `true`]. * **apt_purge_src_list_file**: If the default sources.file must be absent [default: `true`].
* **apt_stretch_manage**: If Stretch configuration should be managed [default: `true`]. * **apt_stretch_manage**: If Stretch configuration should be managed [default: `true`].
@ -41,8 +45,10 @@ Manage APT repos, preferences and configuration for IPR's servers.
## Configuration ## Configuration
### Sources List ### APT Configuration
- Set periodic actions.
### Sources List
Manage Debian's sources.list: Manage Debian's sources.list:
* Remove the default `/etc/apt/sources.list` file. * Remove the default `/etc/apt/sources.list` file.
* Add Stretch repositories. * Add Stretch repositories.

View File

@ -1,6 +1,10 @@
--- ---
# defaults file for apt # defaults file for apt
apt_conf_update_pkg_lists: 1
apt_conf_download_upgradeable_pkg: 1
apt_conf_auto_clean_interval: 0
apt_src_list_manage: true apt_src_list_manage: true
apt_purge_src_list_file: true apt_purge_src_list_file: true

12
tasks/config.yml Normal file
View File

@ -0,0 +1,12 @@
---
# tasks file for config
- name: CONFIG APT
template:
src: "{{ item }}.j2"
dest: "/{{ item }}"
owner: root
group: root
mode: 0644
with_items:
- "etc/apt/apt.conf.d/10periodic"

View File

@ -1,6 +1,13 @@
--- ---
# tasks file for apt # tasks file for apt
- include: config.yml
tags:
- system
- apt
- config
- apt-config
- include: preferences.yml - include: preferences.yml
tags: tags:
- system - system

View File

@ -0,0 +1,10 @@
# {{ ansible_managed }}
# Do "apt-get update" automatically every n-days (0=disable)
APT::Periodic::Update-Package-Lists "{{ apt_conf_update_pkg_lists }}";
# Do "apt-get upgrade --download-only" every n-days (0=disable)
APT::Periodic::Download-Upgradeable-Packages "{{ apt_conf_download_upgradeable_pkg }}";
# Do "apt-get autoclean" every n-days (0=disable)
APT::Periodic::AutocleanInterval "{{ apt_conf_auto_clean_interval }}";