add auditd role
This commit is contained in:
23
tasks/configuration.yaml
Normal file
23
tasks/configuration.yaml
Normal file
@@ -0,0 +1,23 @@
|
||||
---
|
||||
|
||||
- name: push auditd configuration
|
||||
template:
|
||||
src: auditd.conf.j2
|
||||
dest: '{{ auditd_config_dir }}/{{ auditd_config_file }}'
|
||||
mode: '0640'
|
||||
notify:
|
||||
- restart auditd
|
||||
|
||||
- name: push custom rules
|
||||
template:
|
||||
src: custom.rules.j2
|
||||
dest: '{{ auditd_custom_rules_dir }}/custom.rules'
|
||||
mode: '0666'
|
||||
notify:
|
||||
- load custom rules
|
||||
|
||||
- name: start and enable auditd
|
||||
service:
|
||||
name: auditd
|
||||
state: started
|
||||
enabled: true
|
||||
12
tasks/installation.yaml
Normal file
12
tasks/installation.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
|
||||
- name: install packages
|
||||
package:
|
||||
name: '{{ auditd_packages }}'
|
||||
state: present
|
||||
|
||||
- name: ensure rules.d directory exists
|
||||
file:
|
||||
path: '{{ auditd_custom_rules_dir }}'
|
||||
state: directory
|
||||
mode: '0750'
|
||||
19
tasks/main.yaml
Normal file
19
tasks/main.yaml
Normal file
@@ -0,0 +1,19 @@
|
||||
---
|
||||
|
||||
- name: load variables based on distribution type
|
||||
include_vars: '{{ item }}'
|
||||
with_first_found:
|
||||
- '{{ ansible_distribution }}_{{ ansible_distribution_major_version }}.yaml'
|
||||
- '{{ ansible_os_family }}.yaml'
|
||||
tags:
|
||||
- 'auditd_vars'
|
||||
|
||||
- name: install auditd and its components
|
||||
import_tasks: installation.yaml
|
||||
tags:
|
||||
- 'auditd_installation'
|
||||
|
||||
- name: push auditd config
|
||||
import_tasks: configuration.yaml
|
||||
tags:
|
||||
- 'auditd_configuration'
|
||||
Reference in New Issue
Block a user