From 4f0d6b582e0bb07afe97e285c9ed67c049cd04b3 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Thu, 19 Apr 2018 17:48:06 +0200 Subject: [PATCH] Add tasks to install nscd if needed. --- ubuntu-deb-general/defaults/main.yml | 3 +++ ubuntu-deb-general/tasks/install_nscd.yml | 13 +++++++++++++ ubuntu-deb-general/tasks/main.yml | 2 ++ 3 files changed, 18 insertions(+) create mode 100644 ubuntu-deb-general/tasks/install_nscd.yml diff --git a/ubuntu-deb-general/defaults/main.yml b/ubuntu-deb-general/defaults/main.yml index 47f088f7..bb76fb2d 100644 --- a/ubuntu-deb-general/defaults/main.yml +++ b/ubuntu-deb-general/defaults/main.yml @@ -101,6 +101,9 @@ pki_subdirs: # Install our /etc/resolv.conf install_resolvconf: True +# Install nscd if requested +install_nscd: False + # Install and configure munin configure_munin: False diff --git a/ubuntu-deb-general/tasks/install_nscd.yml b/ubuntu-deb-general/tasks/install_nscd.yml new file mode 100644 index 00000000..b2c6ebef --- /dev/null +++ b/ubuntu-deb-general/tasks/install_nscd.yml @@ -0,0 +1,13 @@ +--- +- block: + + - name: Install the nscd service to work around dns timeouts + become_user: root + apt: pkg=nscd state=present update_cache=yes cache_valid_time=1800 + + - name: Ensure thad the nscd service is enabled and running + become_user: root + service: name=nscd state=restarted enabled=yes + + when: install_nscd + tags: [ 'nscd' ] diff --git a/ubuntu-deb-general/tasks/main.yml b/ubuntu-deb-general/tasks/main.yml index f7cfebf4..90d712f7 100644 --- a/ubuntu-deb-general/tasks/main.yml +++ b/ubuntu-deb-general/tasks/main.yml @@ -5,6 +5,8 @@ - import_tasks: dist-upgrade.yml when: dist_upgrade - import_tasks: packages.yml +- import_tasks: nscd.yml + when: install_nscd - import_tasks: ntp.yml - import_tasks: remove-unneeded-pkgs.yml - import_tasks: denyhost.yml