2017-08-16 15:41:59 +02:00
# Apt
1. [Overview ](#overview )
2. [Role Variables ](#role-variables )
3. [Example Playbook ](#example-playbook )
4. [Configuration ](#configuration )
2017-08-17 17:17:11 +02:00
* [APT Configuration ](#apt-configuration )
2017-08-16 15:55:10 +02:00
* [Sources List ](#sources-list )
* [Preferences ](#preferences )
2017-08-17 14:09:55 +02:00
* [Tools ](#tools )
2017-08-16 15:41:59 +02:00
5. [Development ](#development )
6. [License ](#license )
7. [Author Information ](#author-information )
## Overview
Manage APT repos, preferences and configuration for IPR's servers.
## Role Variables
2017-08-17 17:17:11 +02:00
* **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` ].
2017-08-17 17:31:56 +02:00
* **apt_conf_purge_list** : The list of default APT configuration files sets by differents packages.
* **apt_conf_purge_manage** : If the purge of default configuration should be managed [default : `true` ].
2017-08-16 15:41:59 +02:00
* **apt_src_list_manage** : If apt sources list files should be managed [default : `true` ].
2017-08-16 15:48:51 +02:00
* **apt_purge_src_list_file** : If the default sources.file must be absent [default : `true` ].
2017-08-16 15:41:59 +02:00
* **apt_stretch_manage** : If Stretch configuration should be managed [default : `true` ].
2017-08-17 14:09:55 +02:00
* **apt_default_pref_path** : Path to set the default preferences file for all repositories [default : `/etc/apt/preferences.d/default.pref` ].
* **apt_default_pref_tpl** : Template used to generate the previous config file [default : `etc/apt/preferences.d/default.pref.j2` ].
* **apt_tools_list** : The list of additionnals tools to install [default [see below ](#tools )].
* **apt_tools_state** : State of new tools [default : `installed` ].
* **apt_tools_manage** : If those tools should be managed by the role [default : `true` ].
2017-08-17 14:27:13 +02:00
* **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` ].
2017-08-18 11:10:36 +02:00
* **apt_unattended_upgrades** : If `unattended-upgrades` should be managed by the role [default : `yes` ].
2017-08-16 15:41:59 +02:00
## Example Playbook
* Use defaults vars :
``` yml
- hosts: serverXYZ
roles:
- role: ipr-cnrs.apt
```
## Configuration
2017-08-17 17:17:11 +02:00
### APT Configuration
2017-08-18 10:52:23 +02:00
- Ensure to never remove some packages pattern.
2017-08-18 10:32:03 +02:00
- Set general APT configurations.
2017-08-17 17:17:11 +02:00
- Set periodic actions.
2017-08-18 10:12:38 +02:00
- Set dpkg default values.
2017-08-17 17:31:56 +02:00
- Purge default configuration files sets by others apps.
2017-08-16 15:41:59 +02:00
2017-08-17 17:17:11 +02:00
### Sources List
2017-08-16 15:41:59 +02:00
Manage Debian's sources.list :
2017-08-16 15:48:51 +02:00
* Remove the default `/etc/apt/sources.list` file.
2017-08-16 15:41:59 +02:00
* Add Stretch repositories.
2017-08-16 15:44:57 +02:00
* Update Apt if any repositories modifications.
2017-08-16 15:41:59 +02:00
2017-08-16 15:55:10 +02:00
### Preferences
* Set the preferences for all repositories, default to :
2017-08-17 13:54:33 +02:00
- Stretch - 510.
- Stretch Backports - 500.
2017-08-16 15:55:10 +02:00
2017-08-17 14:09:55 +02:00
### Tools
2017-08-17 14:27:13 +02:00
- Ensure to install :
2017-08-17 14:09:55 +02:00
* aptitude (better than `apt` to resolve dependencies issues)
2017-08-17 14:27:13 +02:00
- Ensure to remove really useless packages from a default installation :
* laptop-detect (if a server is a laptop…)
* tasksel (simple interface)
2017-08-18 11:10:36 +02:00
- Manage `unattended-upgrades` .
2017-08-17 14:09:55 +02:00
2017-08-16 15:41:59 +02:00
## Development
This source code comes from our [Gogs instance][apt source] and the [Github repo][apt github] exist just to be able to send the role to Ansible Galaxy…
But feel free to send issue/PR here :)
Thanks to this [hook][gogs to github hook], Github automatically got updates from our [Gogs instance][apt source] :)
## License
[WTFPL][wtfpl website]
## Author Information
Jérémy Gardais
* Source : [on IPR's Gogs][apt source]
* [IPR][ipr website] (Institut de Physique de Rennes)
[gogs to github hook]: https://stackoverflow.com/a/21998477
[apt source]: https://git.ipr.univ-rennes1.fr/cellinfo/ansible.apt
[apt github]: https://github.com/ipr-cnrs/apt
[wtfpl website]: http://www.wtfpl.net/about/
[ipr website]: https://ipr.univ-rennes1.fr/