Manage updatedb configuration file.

This commit is contained in:
Jeremy Gardais 2017-08-01 11:42:43 +02:00
parent 220d5beaf9
commit 681bb83a96
5 changed files with 89 additions and 4 deletions

View File

@ -5,19 +5,29 @@
* [OS Specific Variables](#os-specific-variables)
3. [Example Playbook](#example-playbook)
4. [Packages](#packages)
5. [Development](#development)
5. [License](#license)
6. [Author Information](#author-information)
* [New Packages](#new-packages)
* [Unwanted Packages](#unwanted-packages)
5. [Configuration](#configuration)
* [Updatedb](#updatedb)
6. [Development](#development)
7. [License](#license)
8. [Author Information](#author-information)
## Overview
Manage some packages from 'utils' section (Apt).
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_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`].
* **pkg_utils_updatedb_prunenames**: A list of directory names (without paths) which should not be scanned [default: `[.bzr, .git, .hg, .svn]`].
* **pkg_utils_updatedb_prunepaths**: A list of path names of directories which should not be scanned [default: `[/media, /mnt, /tmp, /var/lib/ceph, /var/spool]`].
* **pkg_utils_updatedb_prunefs**: A list of file system types (as used in /etc/mtab) which should not be scanned [default: `[afs, autofs, binfmt_misc, ceph, cifs, coda, curlftpfs, devfs, devpts, devtmpfs, ecryptfs, fuse.glusterfs, fuse.sshfs, fusesmb, iso9660, lustre, lustre_lite, mfs, ncpfs, NFS, nfs, nfs4, proc, rpc_pipefs, shfs, smbfs, sysfs, ftpfs, tmpfs, udf, usbfs]`].
### OS Specific Variables
@ -84,6 +94,15 @@ sudo multitail -s 2 /var/log/auth.log /var/log/syslog /var/log/mail.log
### Unwanted Packages
* **vim-tiny**: Compact version of vim editor.
## Configuration
### Updatedb
Based on the [Oefenweb module][oefenweb ansible updatedb], thanks!
* Set the default configuration file for *updatedb*.
* Ensure to not scan some path, directories and filesystem.
## 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…

View File

@ -6,3 +6,51 @@ pkg_utils_new_state: 'installed'
pkg_utils_old_state: 'absent'
pkg_utils_old_manage: true
# configuration
pkg_utils_updatedb_conf_path: '/etc/updatedb.conf'
pkg_utils_updatedb_conf_tpl: 'etc/updatedb.conf.j2'
pkg_utils_updatedb_prune_bind_mounts: true
pkg_utils_updatedb_prunenames:
- .bzr
- .git
- .hg
- .svn
pkg_utils_updatedb_prunepaths:
- /media
- /mnt
- /tmp
- /var/lib/ceph
- /var/spool
pkg_utils_updatedb_prunefs:
- afs
- autofs
- binfmt_misc
- ceph
- cifs
- coda
- curlftpfs
- devfs
- devpts
- devtmpfs
- ecryptfs
- fuse.glusterfs
- fuse.sshfs
- fusesmb
- iso9660
- lustre
- lustre_lite
- mfs
- ncpfs
- NFS
- nfs
- nfs4
- proc
- rpc_pipefs
- shfs
- smbfs
- sysfs
- ftpfs
- tmpfs
- udf
- usbfs

View File

@ -24,4 +24,16 @@
- '{{ pkg_utils_old_list }}'
when: pkg_utils_old_manage
# }}}
# configuration {{{
- name: CONFIG updatedb
template:
src: '{{ pkg_utils_updatedb_conf_tpl }}'
dest: '{{ pkg_utils_updatedb_conf_path }}'
owner: root
group: root
mode: 0644
backup: true
# }}}

0
templates/README.md Normal file
View File

View File

@ -0,0 +1,6 @@
# {{ ansible_managed }}
PRUNE_BIND_MOUNTS="{{ 'yes' if pkg_utils_updatedb_prune_bind_mounts else 'no' }}"
PRUNENAMES="{{ pkg_utils_updatedb_prunenames | join(' ') }}"
PRUNEPATHS="{{ pkg_utils_updatedb_prunepaths | join(' ') }}"
PRUNEFS="{{ pkg_utils_updatedb_prunefs | join(' ') }}"