From 2a2b1e619f299b6d408ba36bed4763673caf7634 Mon Sep 17 00:00:00 2001 From: Major Hayden Date: Mon, 7 Nov 2016 10:43:39 -0600 Subject: [PATCH] Fix auditd restart handler It is not possible to restart auditd with systemctl. Using the service interface is required. There are chef cookbooks[1] with the same workaround. This patch also includes a `cache_valid_time` addition to test.yml to unblock the gate. [1] https://github.com/chef-cookbooks/auditd/pull/22/files Closes-Bug: #1662622 Change-Id: I1aa3faf88f5953c230693600fcbcb786d49a35e0 (cherry picked from commit 23af709fff689518f7443d29bdf8f2ee7287f42d) --- handlers/main.yml | 9 ++++++--- tests/test.yml | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/handlers/main.yml b/handlers/main.yml index bc343922..49df1672 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -14,10 +14,13 @@ # limitations under the License. # Restarting services ######################################################## +# +# NOTE(mhayden): It's not possible to use systemd to restart auditd on CentOS +# since it's a special service. Using the old service scripts is required. - name: restart auditd - service: - name: auditd - state: restarted + command: service auditd restart + args: + warn: no - name: restart chrony service: diff --git a/tests/test.yml b/tests/test.yml index 664b96e2..1f4a0d9b 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -19,6 +19,7 @@ - name: Ensure apt cache is updated before testing apt: update_cache: yes + cache_valid_time: "{{ cache_timeout }}" when: ansible_pkg_mgr == 'apt' changed_when: False - name: Ensure OpenStack CI image has a logrotate cron job