apache: Convert modules to use FQCN

This commit is contained in:
Timo Makinen 2022-04-14 13:12:32 +00:00
parent 2ac8d539be
commit b24e7feaeb

View file

@ -1,6 +1,6 @@
---
- name: install apache
package:
ansible.builtin.package:
name: "{{ item }}"
state: installed
with_items:
@ -8,7 +8,7 @@
- mod_ssl
- name: disable plain http and default included configs
lineinfile:
ansible.builtin.lineinfile:
path: /etc/httpd/conf/httpd.conf
line: "#{{ item }}"
regexp: "^#?{{ item|replace('*', '\\*') }}"
@ -18,26 +18,26 @@
notify: restart apache
- name: set server admin address
lineinfile:
ansible.builtin.lineinfile:
path: /etc/httpd/conf/httpd.conf
line: "ServerAdmin webmaster@{{ mail_domain }}"
regexp: "#?ServerAdmin .*"
notify: restart apache
- name: include local configs
lineinfile:
ansible.builtin.lineinfile:
path: /etc/httpd/conf/httpd.conf
line: "IncludeOptional conf.local.d/*.conf"
notify: restart apache
- name: fix selinux contexts from data directory
sefcontext:
community.general.sefcontext:
path: /srv/web(/.*)?
setype: httpd_sys_content_t
when: ansible_selinux_python_present
- name: create data and config directories
file:
ansible.builtin.file:
state: directory
path: "{{ item }}"
mode: 0755
@ -51,7 +51,7 @@
- "/etc/httpd/conf.local.d"
- name: create ssl config
template:
ansible.builtin.template:
src: ssl.conf.j2
dest: /etc/httpd/conf.local.d/ssl.conf
mode: 0644
@ -60,7 +60,7 @@
notify: restart apache
- name: create site config
template:
ansible.builtin.template:
src: site.conf.j2
dest: "/etc/httpd/conf.local.d/{{ inventory_hostname }}.conf"
mode: 0644
@ -69,7 +69,7 @@
notify: restart apache
- name: fix log directory permissions
file:
ansible.builtin.file:
path: /var/log/httpd
state: directory
mode: 0755
@ -77,7 +77,7 @@
group: "{{ ansible_wheel }}"
- name: import sftpuser role
import_role:
ansible.builtin.import_role:
name: sftpuser
vars:
chroot: "/var/log/httpd"
@ -85,7 +85,7 @@
publickeys: "{{ logsync_publickeys }}"
- name: enable apache
service:
ansible.builtin.service:
name: httpd
state: started
enabled: true