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

View file

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