Improve tasks names
This commit is contained in:
parent
9b85b434ef
commit
0273a0d07c
|
@ -1,26 +1,23 @@
|
||||||
---
|
---
|
||||||
# tasks file for packweb-apache
|
- name: Add elements to user account template
|
||||||
|
|
||||||
|
|
||||||
- name: Setting /etc/skel/
|
|
||||||
file:
|
file:
|
||||||
path: "/etc/skel/{{ item.path }}"
|
path: "/etc/skel/{{ item.path }}"
|
||||||
state: "{{ item.state }}"
|
state: "{{ item.state }}"
|
||||||
mode: "{{ item.mode }}"
|
mode: "{{ item.mode }}"
|
||||||
with_items:
|
with_items:
|
||||||
- {path: log, mode: "0750", state: directory}
|
- { path: log, mode: "0750", state: directory }
|
||||||
- {path: awstats, mode: "0750", state: directory}
|
- { path: awstats, mode: "0750", state: directory }
|
||||||
- {path: www, mode: "0750", state: directory}
|
- { path: www, mode: "0750", state: directory }
|
||||||
- {path: log/access.log, mode: "0644", state: touch}
|
- { path: log/access.log, mode: "0644", state: touch }
|
||||||
- {path: log/error.log, mode: "0644", state: touch}
|
- { path: log/error.log, mode: "0644", state: touch }
|
||||||
|
|
||||||
- name: Setting DIR_MODE in /etc/adduser.conf to 0750
|
- name: Force DIR_MODE to 0750 in /etc/adduser.conf
|
||||||
lineinfile:
|
lineinfile:
|
||||||
dest: /etc/adduser.conf
|
dest: /etc/adduser.conf
|
||||||
regexp: '^DIR_MODE='
|
regexp: '^DIR_MODE='
|
||||||
line: 'DIR_MODE=0750'
|
line: 'DIR_MODE=0750'
|
||||||
|
|
||||||
- name: is PATH already present?
|
- name: Check if Apache envvars have a PATH
|
||||||
command: "grep -E '^export PATH ' /etc/apache2/envvars"
|
command: "grep -E '^export PATH ' /etc/apache2/envvars"
|
||||||
failed_when: False
|
failed_when: False
|
||||||
changed_when: False
|
changed_when: False
|
||||||
|
@ -28,7 +25,7 @@
|
||||||
#check_mode: no (for migration to Ansible 2.2)
|
#check_mode: no (for migration to Ansible 2.2)
|
||||||
always_run: yes
|
always_run: yes
|
||||||
|
|
||||||
- name: Add a mark in envvars for PATH
|
- name: Add a PATH envvar for Apache
|
||||||
blockinfile:
|
blockinfile:
|
||||||
dest: /etc/apache2/envvars
|
dest: /etc/apache2/envvars
|
||||||
marker: "## {mark} ANSIBLE MANAGED BLOCK FOR PATH"
|
marker: "## {mark} ANSIBLE MANAGED BLOCK FOR PATH"
|
||||||
|
@ -37,16 +34,16 @@
|
||||||
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||||
when: envvar_grep_path.rc != 0
|
when: envvar_grep_path.rc != 0
|
||||||
|
|
||||||
- name: packages are installed
|
- name: Additional packages are installed
|
||||||
apt:
|
apt:
|
||||||
name: '{{ item }}'
|
name: '{{ item }}'
|
||||||
state: present
|
state: present
|
||||||
with_items:
|
with_items:
|
||||||
- libapache2-mod-evasive
|
|
||||||
- apache2-mpm-itk
|
- apache2-mpm-itk
|
||||||
|
- libapache2-mod-evasive
|
||||||
- libapache2-mod-security2
|
- libapache2-mod-security2
|
||||||
|
|
||||||
- name: Copy Apache itk and evasive settings
|
- name: Copy Apache settings for modules
|
||||||
copy:
|
copy:
|
||||||
src: "{{ item }}"
|
src: "{{ item }}"
|
||||||
dest: "/etc/apache2/conf-available/{{ item }}"
|
dest: "/etc/apache2/conf-available/{{ item }}"
|
||||||
|
@ -59,7 +56,7 @@
|
||||||
- evolinux-evasive.conf
|
- evolinux-evasive.conf
|
||||||
- evolinux-modsec.conf
|
- evolinux-modsec.conf
|
||||||
|
|
||||||
- name: Ensure Apache config files are enabled
|
- name: Ensure Apache modules configs are enabled
|
||||||
command: "a2enconf {{ item }}"
|
command: "a2enconf {{ item }}"
|
||||||
register: command_result
|
register: command_result
|
||||||
changed_when: "'Enabling' in command_result.stderr"
|
changed_when: "'Enabling' in command_result.stderr"
|
||||||
|
@ -68,7 +65,7 @@
|
||||||
- evolinux-evasive
|
- evolinux-evasive
|
||||||
- evolinux-modsec
|
- evolinux-modsec
|
||||||
|
|
||||||
- name: Is log2mail installed?
|
- name: Check if log2mail is installed
|
||||||
command: "apt list --installed log2mail"
|
command: "apt list --installed log2mail"
|
||||||
register: command_result
|
register: command_result
|
||||||
changed_when: False
|
changed_when: False
|
||||||
|
@ -76,7 +73,7 @@
|
||||||
- debug:
|
- debug:
|
||||||
var: command_result
|
var: command_result
|
||||||
|
|
||||||
- name: Add log2mail config for apache segfault
|
- name: Add log2mail config for Apache segfaults
|
||||||
template:
|
template:
|
||||||
src: log2mail-apache.j2
|
src: log2mail-apache.j2
|
||||||
dest: "/etc/log2mail/config/apache"
|
dest: "/etc/log2mail/config/apache"
|
||||||
|
|
Loading…
Reference in a new issue