2020-12-10 07:33:09 +00:00
|
|
|
---
|
2020-12-10 19:26:11 +00:00
|
|
|
# Basic system configuration. All hardening should also be imported here.
|
|
|
|
- name: Configure system
|
|
|
|
hosts: all
|
2020-12-10 07:33:09 +00:00
|
|
|
become: true
|
|
|
|
|
2020-12-10 23:11:41 +00:00
|
|
|
# This is to try to avoid the handler issue in pre/post tasks
|
|
|
|
handlers:
|
2020-12-13 11:54:31 +00:00
|
|
|
- import_tasks: handlers/main.yml
|
2020-12-10 23:11:41 +00:00
|
|
|
|
2020-12-10 07:33:09 +00:00
|
|
|
pre_tasks:
|
|
|
|
- name: Check if ansible cannot be run here
|
|
|
|
stat:
|
|
|
|
path: /etc/no-ansible
|
|
|
|
register: no_ansible
|
|
|
|
|
|
|
|
- name: Verify if we can run ansible
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- "not no_ansible.stat.exists"
|
|
|
|
msg: "/etc/no-ansible exists - skipping run on this node"
|
|
|
|
|
2020-12-10 19:26:11 +00:00
|
|
|
tasks:
|
2020-12-10 19:59:59 +00:00
|
|
|
- name: Loading Variables from OS Common
|
2020-12-13 11:54:31 +00:00
|
|
|
import_tasks: tasks/variable_loader_common.yml
|
2020-12-10 19:59:59 +00:00
|
|
|
|
2020-12-10 19:26:11 +00:00
|
|
|
- name: Configure SSH
|
2020-12-13 11:54:31 +00:00
|
|
|
import_tasks: tasks/ssh_config.yml
|
2020-12-10 07:33:09 +00:00
|
|
|
|
2020-12-10 19:59:59 +00:00
|
|
|
- name: Configure harden settings
|
2020-12-13 11:54:31 +00:00
|
|
|
import_tasks: tasks/harden.yml
|
2020-12-10 19:59:59 +00:00
|
|
|
|
2020-12-12 19:58:00 +00:00
|
|
|
- name: Configure PAM
|
2020-12-13 11:54:31 +00:00
|
|
|
import_tasks: tasks/authentication.yml
|
2020-12-12 12:39:37 +00:00
|
|
|
|
2020-12-13 17:22:55 +00:00
|
|
|
- name: Configure auditd
|
2020-12-13 18:41:26 +00:00
|
|
|
import_tasks: tasks/auditd.yml
|
|
|
|
|
|
|
|
- name: Configure grub
|
|
|
|
import_tasks: tasks/grub.yml
|
2020-12-13 17:22:55 +00:00
|
|
|
|
2020-12-10 07:33:09 +00:00
|
|
|
post_tasks:
|
|
|
|
- name: Touching run file that ansible has ran here
|
|
|
|
file:
|
|
|
|
path: /var/log/ansible.run
|
|
|
|
state: touch
|
2020-12-10 23:40:49 +00:00
|
|
|
mode: '0644'
|
2020-12-11 21:00:14 +00:00
|
|
|
owner: root
|
2020-12-10 23:40:49 +00:00
|
|
|
group: root
|