From d7c256549373aa3be6cf33b4bf578beb9f261895 Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Tue, 11 Jul 2017 17:03:15 +0100 Subject: [PATCH] tasks: horizon_apache: Use the apache2_module Ansible module The upstream bug https://github.com/ansible/ansible-modules-core/issues/5328 has been fixed so remove the workaround and use the Ansible module directly. Moreover, we also need to set 'ignore_configcheck: yes' to ignore the apachectl warnings whe disabling the mpm_* modules. Link: https://github.com/ansible/ansible-modules-core/issues/5328 Change-Id: I20bd0cf6148794c7a6342c3f7eda444cbb715e06 --- tasks/horizon_apache.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tasks/horizon_apache.yml b/tasks/horizon_apache.yml index b0dc41b7..4c32c452 100644 --- a/tasks/horizon_apache.yml +++ b/tasks/horizon_apache.yml @@ -20,12 +20,13 @@ owner: "{{ horizon_apache_default_log_owner }}" group: "{{ horizon_apache_default_log_grp }}" -# Workaround for https://github.com/ansible/ansible-modules-core/issues/5328 -# TODO: Replace using apache2_module when fixed in Ansible release +# NOTE(hwoarang): Module enable/disable process is only functional on Debian +# and SUSE based systems. - name: Enable apache2 modules - command: "{{ (item.state == 'present') | ternary('a2enmod','a2dismod') }} {{ item.name }}" - register: horizon_apache2_module - changed_when: horizon_apache2_module.stdout.find('{{ item.name }} already') == -1 + apache2_module: + name: "{{ item.name }}" + state: "{{ item.state }}" + ignore_configcheck: yes with_items: - { state: present, name: wsgi } - { state: present, name: ssl }