From 266f88f039453e452c528439fc66bf405883a199 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Tue, 1 Aug 2017 14:12:34 +0200 Subject: [PATCH] Manage default editor on the system. --- README.md | 10 +++++++++- defaults/main.yml | 7 ++++++- tasks/main.yml | 7 +++++++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c79c2ae..efc6e17 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ * [New Packages](#new-packages) * [Unwanted Packages](#unwanted-packages) 5. [Configuration](#configuration) + * [Default Editor](#default-editor) * [Updatedb](#updatedb) 6. [Development](#development) 7. [License](#license) @@ -20,8 +21,11 @@ Manage some packages installation and configuration from 'utils' section (Apt). ## Role Variables * **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_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_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`]. @@ -96,6 +100,10 @@ sudo multitail -s 2 /var/log/auth.log /var/log/syslog /var/log/mail.log ## Configuration +### Default Editor + +* Set the *pkg_utils_default_editor.name* var [default : `vim.nox`] as the default editor on the system. + ### Updatedb Based on the [Oefenweb module][oefenweb ansible updatedb], thanks ! diff --git a/defaults/main.yml b/defaults/main.yml index 6f8bdfc..6775c62 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -4,10 +4,15 @@ # packages pkg_utils_new_state: 'installed' -pkg_utils_old_state: 'absent' pkg_utils_old_manage: true +pkg_utils_old_state: 'absent' # 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_tpl: 'etc/updatedb.conf.j2' pkg_utils_updatedb_prune_bind_mounts: true diff --git a/tasks/main.yml b/tasks/main.yml index 0b533f0..dda4d9d 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -27,6 +27,13 @@ # }}} # 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 template: src: '{{ pkg_utils_updatedb_conf_tpl }}'