cellinfo
/
ansible.apt
Archived
2
0
Fork 0

Ensure to install some additionnals tools (aptitude,…).

This commit is contained in:
Jeremy Gardais 2017-08-17 14:09:55 +02:00
parent 8be0485b15
commit 5345c94edb
4 changed files with 27 additions and 4 deletions

View File

@ -6,3 +6,4 @@
* Manage Stretch repositories. * Manage Stretch repositories.
* Update Apt if any repositories modifications. * Update Apt if any repositories modifications.
* Manage default preferences file. * Manage default preferences file.
* Ensure to install some additionnals tools (aptitude,…).

View File

@ -6,6 +6,7 @@
4. [Configuration](#configuration) 4. [Configuration](#configuration)
* [Sources List](#sources-list) * [Sources List](#sources-list)
* [Preferences](#preferences) * [Preferences](#preferences)
* [Tools](#tools)
5. [Development](#development) 5. [Development](#development)
6. [License](#license) 6. [License](#license)
7. [Author Information](#author-information) 7. [Author Information](#author-information)
@ -19,8 +20,11 @@ Manage APT repos, preferences and configuration for IPR's servers.
* **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`].
* **apt_default_pref_path**: Path to set the default preferences file for all repositories [default: `'/etc/apt/preferences.d/default.pref'`]. * **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_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`].
## Example Playbook ## Example Playbook
@ -42,11 +46,14 @@ Manage Debian's sources.list:
* Update Apt if any repositories modifications. * Update Apt if any repositories modifications.
### Preferences ### Preferences
* Set the preferences for all repositories, default to: * Set the preferences for all repositories, default to:
- Stretch - 510. - Stretch - 510.
- Stretch Backports - 500. - Stretch Backports - 500.
### Tools
Ensure to install:
* aptitude (better than `apt` to resolve dependencies issues)
## Development ## 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… 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…

View File

@ -8,3 +8,8 @@ apt_stretch_manage: true
apt_default_pref_path: '/etc/apt/preferences.d/default.pref' apt_default_pref_path: '/etc/apt/preferences.d/default.pref'
apt_default_pref_tpl: 'etc/apt/preferences.d/default.pref.j2' apt_default_pref_tpl: 'etc/apt/preferences.d/default.pref.j2'
apt_tools_list:
- aptitude
apt_tools_state: 'installed'
apt_tools_manage: true

View File

@ -7,7 +7,7 @@
src: '{{ apt_default_pref_tpl }}' src: '{{ apt_default_pref_tpl }}'
dest: '{{ apt_default_pref_path }}' dest: '{{ apt_default_pref_path }}'
# Sources list # Sources list {{{
## Purge sources.list file ## Purge sources.list file
- name: CONFIG remove sources.list file - name: CONFIG remove sources.list file
file: file:
@ -37,3 +37,13 @@
- backports - backports
notify: aptitude update notify: aptitude update
when: apt_src_list_manage and apt_stretch_manage when: apt_src_list_manage and apt_stretch_manage
# }}}
# Packages
- name: Ensure useful tools packages
apt:
name: '{{ item }}'
state: '{{ apt_tools_state }}'
with_items:
- '{{ apt_tools_list }}'
when: apt_tools_manage