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
This commit is contained in:
Markos Chandras 2017-07-11 17:03:15 +01:00
parent 88d8b84d5d
commit d7c2565493

View File

@ -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 }