apache: ansible-lint fixes
This commit is contained in:
parent
6f743ee8f1
commit
09f7750206
2 changed files with 18 additions and 18 deletions
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: restart apache
|
- name: Restart apache
|
||||||
service:
|
ansible.builtin.service:
|
||||||
name: httpd
|
name: httpd
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: install apache
|
- name: Install apache
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
state: installed
|
state: installed
|
||||||
|
@ -7,7 +7,7 @@
|
||||||
- httpd
|
- httpd
|
||||||
- mod_ssl
|
- mod_ssl
|
||||||
|
|
||||||
- name: disable plain http and default included configs
|
- name: Disable plain http and default included configs
|
||||||
ansible.builtin.lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: /etc/httpd/conf/httpd.conf
|
path: /etc/httpd/conf/httpd.conf
|
||||||
line: "#{{ item }}"
|
line: "#{{ item }}"
|
||||||
|
@ -15,28 +15,28 @@
|
||||||
with_items:
|
with_items:
|
||||||
- "Listen 80"
|
- "Listen 80"
|
||||||
- "IncludeOptional conf.d/*.conf"
|
- "IncludeOptional conf.d/*.conf"
|
||||||
notify: restart apache
|
notify: Restart apache
|
||||||
|
|
||||||
- name: set server admin address
|
- name: Set server admin address
|
||||||
ansible.builtin.lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: /etc/httpd/conf/httpd.conf
|
path: /etc/httpd/conf/httpd.conf
|
||||||
line: "ServerAdmin webmaster@{{ mail_domain }}"
|
line: "ServerAdmin webmaster@{{ mail_domain }}"
|
||||||
regexp: "#?ServerAdmin .*"
|
regexp: "#?ServerAdmin .*"
|
||||||
notify: restart apache
|
notify: Restart apache
|
||||||
|
|
||||||
- name: include local configs
|
- name: Include local configs
|
||||||
ansible.builtin.lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: /etc/httpd/conf/httpd.conf
|
path: /etc/httpd/conf/httpd.conf
|
||||||
line: "IncludeOptional conf.local.d/*.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:
|
community.general.sefcontext:
|
||||||
path: /srv/web(/.*)?
|
path: /srv/web(/.*)?
|
||||||
setype: httpd_sys_content_t
|
setype: httpd_sys_content_t
|
||||||
when: ansible_selinux_python_present
|
when: ansible_selinux_python_present
|
||||||
|
|
||||||
- name: create data and config directories
|
- name: Create data and config directories
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
state: directory
|
state: directory
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
|
@ -50,25 +50,25 @@
|
||||||
- "/srv/web/{{ inventory_hostname }}"
|
- "/srv/web/{{ inventory_hostname }}"
|
||||||
- "/etc/httpd/conf.local.d"
|
- "/etc/httpd/conf.local.d"
|
||||||
|
|
||||||
- name: create ssl config
|
- name: Create SSL config
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: ssl.conf.j2
|
src: ssl.conf.j2
|
||||||
dest: /etc/httpd/conf.local.d/ssl.conf
|
dest: /etc/httpd/conf.local.d/ssl.conf
|
||||||
mode: 0644
|
mode: 0644
|
||||||
owner: root
|
owner: root
|
||||||
group: "{{ ansible_wheel }}"
|
group: "{{ ansible_wheel }}"
|
||||||
notify: restart apache
|
notify: Restart apache
|
||||||
|
|
||||||
- name: create site config
|
- name: Create site config
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: site.conf.j2
|
src: site.conf.j2
|
||||||
dest: "/etc/httpd/conf.local.d/{{ inventory_hostname }}.conf"
|
dest: "/etc/httpd/conf.local.d/{{ inventory_hostname }}.conf"
|
||||||
mode: 0644
|
mode: 0644
|
||||||
owner: root
|
owner: root
|
||||||
group: "{{ ansible_wheel }}"
|
group: "{{ ansible_wheel }}"
|
||||||
notify: restart apache
|
notify: Restart apache
|
||||||
|
|
||||||
- name: fix log directory permissions
|
- name: Fix log directory permissions
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: /var/log/httpd
|
path: /var/log/httpd
|
||||||
state: directory
|
state: directory
|
||||||
|
@ -76,7 +76,7 @@
|
||||||
owner: root
|
owner: root
|
||||||
group: "{{ ansible_wheel }}"
|
group: "{{ ansible_wheel }}"
|
||||||
|
|
||||||
- name: import sftpuser role
|
- name: Import sftpuser role
|
||||||
ansible.builtin.import_role:
|
ansible.builtin.import_role:
|
||||||
name: sftpuser
|
name: sftpuser
|
||||||
vars:
|
vars:
|
||||||
|
@ -84,7 +84,7 @@
|
||||||
user: logsync
|
user: logsync
|
||||||
publickeys: "{{ logsync_publickeys }}"
|
publickeys: "{{ logsync_publickeys }}"
|
||||||
|
|
||||||
- name: enable apache
|
- name: Enable apache
|
||||||
ansible.builtin.service:
|
ansible.builtin.service:
|
||||||
name: httpd
|
name: httpd
|
||||||
state: started
|
state: started
|
||||||
|
|
Loading…
Add table
Reference in a new issue