1
0
mirror of https://github.com/inofix/common-playbooks.git synced 2026-02-05 12:45:29 +01:00

Apache Modules

Store more infos in the dict mainly to address the nameing constraints
in ansible.
This commit is contained in:
Michael Lustenberger
2020-05-24 00:19:10 +02:00
parent b187da86b4
commit 357ab813c2
2 changed files with 5 additions and 6 deletions

View File

@@ -15,9 +15,8 @@
vars:
app__apache__mod_pkgs: '{{ os__pkg_name.apache_mod[os__short] | d(os__pkg_name.apache_mod[os__distro]) }}'
## app__apache__mods: '{{ app__apache__modules | list() | unique() }}'
app__apache__mod_helper: '{% for key, value in app__apache__modules.items() %}{% if value == True %}{{ app__apache__mod_pkgs[key] | d() }};{% endif %}{% endfor %}'
app__apache__mod_helper: '{% for key, value in app__apache__modules.items() %}{% if value.enable == True %}{{ app__apache__mod_pkgs[key] | d() }};{% endif %}{% endfor %}'
app__apache__yapkg__names: '{{ os__pkg_name.apache[os__short] | d(os__pkg_name.apache[os__distro]) }} + {{ app__apache__mod_helper.split(";") }}'
# use fqdn if ansible_fqdn is not set
#TODO why is it not forwarded from reclass?
# ansible_fqdn: '{{ fqdn }}'

View File

@@ -1,12 +1,12 @@
---
- name: "Enable configs"
command: 'a2enconf {{ item.key }}'
when: '{{ item.value }}'
command: 'a2enconf {{ item.value.name }}'
when: '{{ item.value.enable }}'
with_dict: '{{ app__apache__configs }}'
- name: "Enable modules"
command: 'a2enmod {{ item.key }}'
when: '{{ item.value }}'
command: 'a2enmod {{ item.value.name }}'
when: '{{ item.value.enable }}'
with_dict: '{{ app__apache__modules }}'
- name: "Production level settings - part I"