Manage default editor on the system.

This commit is contained in:
Jeremy Gardais 2017-08-01 14:12:34 +02:00
parent c1583ef410
commit 266f88f039
3 changed files with 22 additions and 2 deletions

View File

@ -8,6 +8,7 @@
* [New Packages](#new-packages) * [New Packages](#new-packages)
* [Unwanted Packages](#unwanted-packages) * [Unwanted Packages](#unwanted-packages)
5. [Configuration](#configuration) 5. [Configuration](#configuration)
* [Default Editor](#default-editor)
* [Updatedb](#updatedb) * [Updatedb](#updatedb)
6. [Development](#development) 6. [Development](#development)
7. [License](#license) 7. [License](#license)
@ -20,8 +21,11 @@ Manage some packages installation and configuration from 'utils' section (Apt).
## Role Variables ## Role Variables
* **pkg_utils_new_state**: State of new pkg_utils packages [default: `installed`]. * **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`]. * **pkg_utils_old_manage**: If this role should manage unwanted packages [default: `true`].
* **pkg_utils_old_state**: State of useless pkg_utils [default: `absent`].
* **pkg_utils_default_editor_name**: The default editor name [default: `vim.nox`].
* **pkg_utils_default_editor_path**: The default editor path [default: `/usr/bin/vim.nox`].
* **pkg_utils_default_editor_manage**: If the default editor should be managed [default: `true`].
* **pkg_utils_updatedb_conf_path**: Configuration file for **updatedb** [default: `/etc/updatedb.conf`]. * **pkg_utils_updatedb_conf_path**: Configuration file for **updatedb** [default: `/etc/updatedb.conf`].
* **pkg_utils_updatedb_conf_tpl**: Template used to generate the previous config file [default: `etc/updatedb.conf.j2`]. * **pkg_utils_updatedb_conf_tpl**: Template used to generate the previous config file [default: `etc/updatedb.conf.j2`].
* **pkg_utils_updatedb_prune_bind_mounts**: Whether or not bind mounts are scanned [default: `true`]. * **pkg_utils_updatedb_prune_bind_mounts**: Whether or not bind mounts are scanned [default: `true`].
@ -96,6 +100,10 @@ sudo multitail -s 2 /var/log/auth.log /var/log/syslog /var/log/mail.log
## Configuration ## Configuration
### Default Editor
* Set the *pkg_utils_default_editor.name* var [default: `vim.nox`] as the default editor on the system.
### Updatedb ### Updatedb
Based on the [Oefenweb module][oefenweb ansible updatedb], thanks! Based on the [Oefenweb module][oefenweb ansible updatedb], thanks!

View File

@ -4,10 +4,15 @@
# packages # packages
pkg_utils_new_state: 'installed' pkg_utils_new_state: 'installed'
pkg_utils_old_state: 'absent'
pkg_utils_old_manage: true pkg_utils_old_manage: true
pkg_utils_old_state: 'absent'
# configuration # configuration
pkg_utils_default_editor_manage: true
pkg_utils_default_editor_name: 'vim.nox'
pkg_utils_default_editor_path: '/usr/bin/vim.nox'
pkg_utils_updatedb_conf_path: '/etc/updatedb.conf' pkg_utils_updatedb_conf_path: '/etc/updatedb.conf'
pkg_utils_updatedb_conf_tpl: 'etc/updatedb.conf.j2' pkg_utils_updatedb_conf_tpl: 'etc/updatedb.conf.j2'
pkg_utils_updatedb_prune_bind_mounts: true pkg_utils_updatedb_prune_bind_mounts: true

View File

@ -27,6 +27,13 @@
# }}} # }}}
# configuration {{{ # configuration {{{
- name: CONFIG {{ pkg_utils_default_editor_name }} as default editor
alternatives:
name: editor
path: '{{ pkg_utils_default_editor_path }}'
priority: 80
when: pkg_utils_default_editor_manage
- name: CONFIG updatedb - name: CONFIG updatedb
template: template:
src: '{{ pkg_utils_updatedb_conf_tpl }}' src: '{{ pkg_utils_updatedb_conf_tpl }}'