apache: ansible-lint fixes

This commit is contained in:
Timo Makinen 2022-10-29 18:02:17 +00:00
parent 6f743ee8f1
commit 09f7750206
2 changed files with 18 additions and 18 deletions

View file

@ -1,5 +1,5 @@
---
- name: restart apache
service:
- name: Restart apache
ansible.builtin.service:
name: httpd
state: restarted

View file

@ -1,5 +1,5 @@
---
- name: install apache
- name: Install apache
ansible.builtin.package:
name: "{{ item }}"
state: installed
@ -7,7 +7,7 @@
- httpd
- mod_ssl
- name: disable plain http and default included configs
- name: Disable plain http and default included configs
ansible.builtin.lineinfile:
path: /etc/httpd/conf/httpd.conf
line: "#{{ item }}"
@ -15,28 +15,28 @@
with_items:
- "Listen 80"
- "IncludeOptional conf.d/*.conf"
notify: restart apache
notify: Restart apache
- name: set server admin address
- name: Set server admin address
ansible.builtin.lineinfile:
path: /etc/httpd/conf/httpd.conf
line: "ServerAdmin webmaster@{{ mail_domain }}"
regexp: "#?ServerAdmin .*"
notify: restart apache
notify: Restart apache
- name: include local configs
- name: Include local configs
ansible.builtin.lineinfile:
path: /etc/httpd/conf/httpd.conf
line: "IncludeOptional conf.local.d/*.conf"
notify: restart apache
notify: Restart apache
- name: fix selinux contexts from data directory
- name: Fix SELinux contexts from data directory
community.general.sefcontext:
path: /srv/web(/.*)?
setype: httpd_sys_content_t
when: ansible_selinux_python_present
- name: create data and config directories
- name: Create data and config directories
ansible.builtin.file:
state: directory
path: "{{ item }}"
@ -50,25 +50,25 @@
- "/srv/web/{{ inventory_hostname }}"
- "/etc/httpd/conf.local.d"
- name: create ssl config
- name: Create SSL config
ansible.builtin.template:
src: ssl.conf.j2
dest: /etc/httpd/conf.local.d/ssl.conf
mode: 0644
owner: root
group: "{{ ansible_wheel }}"
notify: restart apache
notify: Restart apache
- name: create site config
- name: Create site config
ansible.builtin.template:
src: site.conf.j2
dest: "/etc/httpd/conf.local.d/{{ inventory_hostname }}.conf"
mode: 0644
owner: root
group: "{{ ansible_wheel }}"
notify: restart apache
notify: Restart apache
- name: fix log directory permissions
- name: Fix log directory permissions
ansible.builtin.file:
path: /var/log/httpd
state: directory
@ -76,7 +76,7 @@
owner: root
group: "{{ ansible_wheel }}"
- name: import sftpuser role
- name: Import sftpuser role
ansible.builtin.import_role:
name: sftpuser
vars:
@ -84,7 +84,7 @@
user: logsync
publickeys: "{{ logsync_publickeys }}"
- name: enable apache
- name: Enable apache
ansible.builtin.service:
name: httpd
state: started