Remove some useless packages.

This commit is contained in:
Jeremy Gardais 2017-08-01 11:26:14 +02:00
parent 56a794af8e
commit 220d5beaf9
4 changed files with 29 additions and 1 deletions

View File

@ -15,13 +15,16 @@ Manage some packages from 'utils' section (Apt).
## Role Variables ## Role Variables
* **pkg_utils_new_state**: State of new pkg_utils packages [default: `latest`]. * **pkg_utils_new_state**: State of new pkg_utils packages [default: `installed`].
* **pkg_utils_old_state**: State of useless pkg_utils [default: `absent`].
* **pkg_utils_old_manage**: If this role should manage unwanted packages [default: `true`].
### OS Specific Variables ### OS Specific Variables
Please see default value by Operating System file in [vars][vars directory] directory. Please see default value by Operating System file in [vars][vars directory] directory.
* **pkg_utils_new_list**: The list of packages to install to provide `pkg_utils`. * **pkg_utils_new_list**: The list of packages to install to provide `pkg_utils`.
* **pkg_utils_old_list**: The list of unwanted packages to remove.
## Example Playbook ## Example Playbook
@ -33,6 +36,15 @@ Please see default value by Operating System file in [vars][vars directory] dire
- role: ipr-cnrs.pkg_utils - role: ipr-cnrs.pkg_utils
``` ```
* Don't remove any packages:
``` yml
- hosts: serverXYZ
roles:
- role: ipr-cnrs.pkg_utils
pkg_utils_old_manage: false
```
## Packages ## Packages
### New Packages ### New Packages
@ -69,6 +81,9 @@ sudo multitail -s 2 /var/log/auth.log /var/log/syslog /var/log/mail.log
* **zip**: Archiver for .zip files. * **zip**: Archiver for .zip files.
* **zsh**: Shell with lots of features. * **zsh**: Shell with lots of features.
### Unwanted Packages
* **vim-tiny**: Compact version of vim editor.
## Development ## Development
This source code comes from our [Gogs instance][pkg_utils source] and the [Github repo][pkg_utils github] exist just to be able to send the role to Ansible Galaxy… This source code comes from our [Gogs instance][pkg_utils source] and the [Github repo][pkg_utils github] exist just to be able to send the role to Ansible Galaxy…

View File

@ -4,3 +4,5 @@
# packages # packages
pkg_utils_new_state: 'installed' pkg_utils_new_state: 'installed'
pkg_utils_old_state: 'absent'
pkg_utils_old_manage: true

View File

@ -16,4 +16,12 @@
with_items: with_items:
- '{{ pkg_utils_new_list }}' - '{{ pkg_utils_new_list }}'
- name: Remove useless packages
apt:
name: '{{ item }}'
state: '{{ pkg_utils_old_state }}'
with_items:
- '{{ pkg_utils_old_list }}'
when: pkg_utils_old_manage
# }}} # }}}

View File

@ -22,3 +22,6 @@ pkg_utils_new_list:
- 'vim-scripts' - 'vim-scripts'
- 'zip' - 'zip'
- 'zsh' - 'zsh'
pkg_utils_old_list:
- 'vim-tiny'