cellinfo
/
ansible.apt
Archived
2
0
Fork 0

Compare commits

..

9 Commits

Author SHA1 Message Date
Jeremy Gardais b94844734f
Stop support and use DebOps apt roles 2018-08-06 15:52:15 +02:00
Jeremy Gardais f07c82d1d9 Version 1.1. 2018-01-04 11:51:27 +01:00
Jeremy Gardais 952ab95073 Add possibility to define APT preferences for Proxmox reposity. 2017-12-19 15:36:45 +01:00
Jeremy Gardais 689c27fef6 Fix tasks name. 2017-11-29 14:45:38 +01:00
Jeremy Gardais 7593a2c5a5 Rename apt_old_* to apt_unwanted_* vars. 2017-11-29 14:41:53 +01:00
Jeremy Gardais c8ed34b932 Remove default apt.conf.d files
01autoremove and 50unattended-upgrades are managed by the role but the
files provided by the package doesn't have ".conf" extension.
2017-11-29 14:34:54 +01:00
Jeremy Gardais 69c11e4717 Add a example howto to use the role for installation with X session.
Cause by default the tasksel* packages are removed, so it can also
remove desktop environment.
2017-11-29 14:33:28 +01:00
Guillaume Raffy f3c78bacc4 added comments 2017-10-03 16:03:34 +02:00
Jeremy Gardais faa5f6f0ed Add Stretch-Security repository. 2017-09-12 09:27:34 +02:00
8 changed files with 77 additions and 15 deletions

View File

@ -1,3 +1,13 @@
This role is **NO LONGER SUPPORTED**, please take a look to [debops.apt][debops doc apt], [debops.apt_install][debops doc apt_install], [debops.apt_preferences][debops doc apt_preferences] and all others [DebOps apt_* roles][debops doc apt roles].
## v1.1
### Enhancements
* Add Stretch-Security repository.
* Update README.md with example.
* Rename apt_old_* to apt_unwanted_* vars.
* Fix tasks name.
* Add possibility to define APT preferences for Proxmox reposity.
## v1.0.2

View File

@ -1,5 +1,7 @@
# Apt
This role is **NO LONGER SUPPORTED**, please take a look to [debops.apt][debops doc apt], [debops.apt_install][debops doc apt_install], [debops.apt_preferences][debops doc apt_preferences] and all others [DebOps apt_* roles][debops doc apt roles].
1. [Overview](#overview)
2. [Role Variables](#role-variables)
3. [Example Playbook](#example-playbook)
@ -31,9 +33,9 @@ Manage APT repos, preferences and configuration for IPR's servers.
* **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`].
* **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_unwanted_pkg_list**: The list of totally useless packages for a production server [default [see below](#tools)].
* **apt_unwanted_pkg_state**: State of old packages [default: `absent`].
* **apt_unwanted_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`].
* **apt_unattended_upgrades_blacklist**: List of packages to not update (regexp are supported) [default: `[]`].
@ -47,6 +49,15 @@ Manage APT repos, preferences and configuration for IPR's servers.
- role: ipr-cnrs.apt
```
* For a system with an X session, you may let the old packages unmanaged:
``` yml
- hosts: serverXYZ
roles:
- role: ipr-cnrs.apt
apt_unwanted_pkg_manage: false
```
## Configuration
### APT Configuration
@ -59,7 +70,7 @@ Manage APT repos, preferences and configuration for IPR's servers.
### Sources List
Manage Debian's sources.list:
* Add Stretch repositories.
* Add Stretch repositories (main, security and backports).
* Remove the default `/etc/apt/sources.list` file.
* Update Apt if any repositories modifications.
@ -99,3 +110,7 @@ Jérémy Gardais
[apt github]: https://github.com/ipr-cnrs/apt
[wtfpl website]: http://www.wtfpl.net/about/
[ipr website]: https://ipr.univ-rennes1.fr/
[debops doc apt_install]: https://docs.debops.org/en/master/ansible/roles/debops.apt_install/index.html
[debops doc apt]: https://docs.debops.org/en/master/ansible/roles/debops.apt/index.html
[debops doc apt_preferences]: https://docs.debops.org/en/master/ansible/roles/debops.apt_preferences/index.html
[debops doc apt roles]: https://docs.debops.org/en/master/search.html?q=debops.apt_&check_keywords=yes

View File

@ -7,9 +7,11 @@ apt_conf_download_upgradeable_pkg: 1
apt_conf_auto_clean_interval: 0
apt_conf_purge_list:
- 00trustcdrom
- 01autoremove
- 15hobbit-plugins-update-stamp
- 20auto-upgrades
- 20listchanges
- 50unattended-upgrades
- 70debconf
apt_conf_purge_manage: true
@ -28,12 +30,17 @@ apt_tools_list:
- aptitude
apt_tools_state: 'installed'
apt_tools_manage: true
apt_old_pkg_list:
apt_unwanted_pkg_list:
- laptop-detect
- tasksel
apt_old_pkg_state: 'absent'
apt_old_pkg_manage: true
apt_unwanted_pkg_state: 'absent'
apt_unwanted_pkg_manage: true
# unattended-upgrades
apt_unattended_upgrades: yes
apt_unattended_upgrades_blacklist: []
# proxmox
apt_proxmox_manage: false
apt_proxmox_pref_path: '/etc/apt/preferences.d/proxmox.pref'
apt_proxmox_pref_tpl: 'etc/apt/preferences.d/proxmox.pref.j2'

View File

@ -20,7 +20,7 @@
- name: INSTALL purge useless packages
apt:
name: '{{ item }}'
state: '{{ apt_old_pkg_state }}'
state: '{{ apt_unwanted_pkg_state }}'
with_items:
- '{{ apt_old_pkg_list }}'
when: apt_old_pkg_manage
- '{{ apt_unwanted_pkg_list }}'
when: apt_unwanted_pkg_manage

View File

@ -2,7 +2,14 @@
# task file for preferences
# Default preferences file
- name: CONFIG default preferences
- name: PREF default preferences file
template:
src: '{{ apt_default_pref_tpl }}'
dest: '{{ apt_default_pref_path }}'
# Proxmox preferences file
- name: PREF Proxmox preferences file
template:
src: '{{ apt_proxmox_pref_tpl }}'
dest: '{{ apt_proxmox_pref_path }}'
when: apt_proxmox_manage

View File

@ -3,7 +3,7 @@
# Sources list
## Stretch {{{
- name: CONFIG stretch official sources.list
- name: REPOS stretch official sources.list
apt_repository:
repo: "{{ item }} http://httpredir.debian.org/debian/ stretch main contrib non-free"
filename: stretch
@ -14,7 +14,18 @@
notify: aptitude update
when: apt_src_list_manage and apt_stretch_manage
- name: CONFIG stretch backports sources.list
- name: REPOS stretch security sources.list
apt_repository:
repo: "{{ item }} http://httpredir.debian.org/debian-security/ stretch/updates main contrib non-free"
filename: stretch.security
update_cache: no
with_items:
- deb
- deb-src
notify: aptitude update
when: apt_src_list_manage and apt_stretch_manage
- name: REPOS stretch backports sources.list
apt_repository:
repo: "deb http://httpredir.debian.org/debian/ stretch-{{ item }} main contrib non-free"
filename: stretch.bpo
@ -26,7 +37,7 @@
# }}}
## Purge sources.list file
- name: CONFIG remove sources.list file
- name: REPOS remove sources.list file
file:
path: /etc/apt/sources.list
state: absent

View File

@ -1,12 +1,17 @@
# {{ ansible_managed }}
{% if apt_stretch_manage %}
Explanation: Packages from Stretch Security (Stable)
Package: *
Pin: release o=Debian,a=stable,n=stretch,l=Debian-Security
Pin-Priority: 520
Explanation: Packages from Stretch (Stable)
Package: *
Pin: release o=Debian,a=stable,n=stretch,l=Debian
Pin-Priority: 510
Explanation: Packages from Stretch (Stable)
Explanation: Packages from Stretch Backports (Stable)
Package: *
Pin: release o=Debian Backports,a=stretch-backports,n=stretch-backports,l=Debian Backports
Pin-Priority: 500

View File

@ -0,0 +1,7 @@
# {{ ansible_managed }}
Explanation: Packages from Proxmox VE
Package: *
Pin: release o=Proxmox,a=stable,n=stretch,l=Proxmox Debian repository
Pin-Priority: 530