evomaintenance: add some tags on tasks

This commit is contained in:
Jérémy Lecour 2018-01-02 16:45:36 +01:00 committed by Jérémy Lecour
parent f09d93aadb
commit e8c0e43cf0
2 changed files with 24 additions and 0 deletions

View file

@ -3,11 +3,15 @@
include_role:
name: apt
tasks_from: evolix_public.yml
tags:
- evomaintenance
- name: evomaintenance is installed
apt:
name: evomaintenance
allow_unauthenticated: yes
tags:
- evomaintenance
- name: configuration is applied
template:
@ -16,20 +20,28 @@
owner: root
group: root
mode: "0600"
tags:
- evomaintenance
# - name: list users with a shell
# shell: "cat /etc/passwd | grep -vE \"^root:\" | grep -E \":/[^:]+sh$\" | cut -d: -f6"
# changed_when: False
# check_mode: no
# register: home_of_shell_users
# tags:
# - evomaintenance
#
# - include: trap.yml home={{ item }}
# with_items: "{{ home_of_shell_users.stdout_lines }}"
# tags:
# - evomaintenance
- name: Is minifirewall installed?
stat:
path: /etc/default/minifirewall
register: minifirewall_default_file
tags:
- evomaintenance
- name: minifirewall section for evomaintenance
lineinfile:
@ -38,6 +50,8 @@
insertafter: "^# EvoMaintenance"
with_items: "{{ evomaintenance_hosts }}"
when: minifirewall_default_file.stat.exists
tags:
- evomaintenance
- name: remove minifirewall example rule for the proxy
lineinfile:
@ -45,3 +59,5 @@
regexp: '^#.*(--sport 5432).*(-s X\.X\.X\.X)'
state: absent
when: minifirewall_default_file.stat.exists
tags:
- evomaintenance

View file

@ -3,6 +3,8 @@
path: "{{ home }}/.bash_profile"
check_mode: no
register: bash_profile
tags:
- evomaintenance
- name: install shell trap in {{ home }}/.bash_profile
lineinfile:
@ -11,6 +13,8 @@
insertafter: EOF
create: no
when: bash_profile.stat.exists
tags:
- evomaintenance
- name: is {{ home }}/.profile present?
stat:
@ -18,6 +22,8 @@
check_mode: no
register: profile
when: not bash_profile.stat.exists
tags:
- evomaintenance
- name: install shell trap in {{ home }}/.profile
lineinfile:
@ -26,3 +32,5 @@
insertafter: EOF
create: yes
when: not bash_profile.stat.exists
tags:
- evomaintenance