diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e8b474..6b999b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,3 +6,4 @@ * Manage Stretch repositories. * Update Apt if any repositories modifications. * Manage default preferences file. +* Ensure to install some additionnals tools (aptitude,…). diff --git a/README.md b/README.md index fb48442..84e550c 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ 4. [Configuration](#configuration) * [Sources List](#sources-list) * [Preferences](#preferences) + * [Tools](#tools) 5. [Development](#development) 6. [License](#license) 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_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_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_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`]. ## Example Playbook @@ -42,11 +46,14 @@ Manage Debian's sources.list : * Update Apt if any repositories modifications. ### Preferences - * Set the preferences for all repositories, default to : - Stretch - 510. - Stretch Backports - 500. +### Tools +Ensure to install : + * aptitude (better than `apt` to resolve dependencies issues) + ## 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… diff --git a/defaults/main.yml b/defaults/main.yml index 95b42ae..d7cc5d8 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -8,3 +8,8 @@ apt_stretch_manage: true apt_default_pref_path: '/etc/apt/preferences.d/default.pref' apt_default_pref_tpl: 'etc/apt/preferences.d/default.pref.j2' + +apt_tools_list: + - aptitude +apt_tools_state: 'installed' +apt_tools_manage: true diff --git a/tasks/main.yml b/tasks/main.yml index d0f2efa..e4b2160 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -7,7 +7,7 @@ src: '{{ apt_default_pref_tpl }}' dest: '{{ apt_default_pref_path }}' -# Sources list +# Sources list {{{ ## Purge sources.list file - name: CONFIG remove sources.list file file: @@ -37,3 +37,13 @@ - backports notify: aptitude update 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