Ensure the updatedb does not include Docker images

This commit is contained in:
Joseph Benden 2017-08-06 10:38:25 -07:00
parent a4bc441310
commit f26f025cc6

View File

@ -38,3 +38,17 @@
repo: "{{ docker_apt_repository }}"
state: present
update_cache: yes
- name: Check if /etc/updatedb.conf exists
stat:
path: /etc/updatedb.conf
register: updatedb_conf_exists
- name: Ensure updatedb does not index /var/lib/docker
lineinfile:
dest: /etc/updatedb.conf
state: present
backrefs: yes
regexp: '^PRUNEPATHS="(|.* )(/var/lib/docker)?(| .*)"$'
line: 'PRUNEPATHS="\1/var/lib/docker\3"'
when: updatedb_conf_exists.stat.exists