make it work on almlinux and debian, really

This commit is contained in:
2023-11-21 14:40:05 +01:00
parent db9f049e68
commit 3bc092ada5
6 changed files with 23 additions and 10 deletions

View File

@@ -2,7 +2,7 @@
# tasks file for myapache
#
- name: include distribution specific variables
include_vars: "{{ ansible_distribution|lower }}.yml"
include_vars: "{{ ansible_os_family|lower }}.yml"
- name: install apache almost anywhere
tags: httpd
@@ -18,7 +18,7 @@
dest: "{{ apache_conf_dir}}/vhost.conf"
mode: 0640
owner: root
group: apache
group: "{{ apache_group_name }}"
- name: activate apache
tags: httpd
@@ -35,23 +35,21 @@
state: enabled
ignore_errors: yes
notify: reload firewalld
when: ansible_distribution=="CentOS" or "RedHat"
when: ansible_os_family=="RedHat"
- name: create documentroot
tags: httpd
file:
name: "{{ item.documentroot }}"
state: directory
loop:
- "{{ apache_vhosts }}"
loop: "{{ apache_vhosts }}"
- name: create documentroot/Private
tags: httpd
file:
name: "{{ item.documentroot }}/Private"
state: directory
loop:
- "{{ apache_vhosts }}"
loop: "{{ apache_vhosts }}"
- name: create index file
tags: httpd
@@ -59,5 +57,4 @@
src: index.html
dest: "{{ item.documentroot }}/index.html"
mode: 0644
loop:
- "{{ apache_vhosts }}"
loop: "{{ apache_vhosts }}"