mono-infrastructure/ansible/playbooks/init-rocky-system-config.yml

41 lines
986 B
YAML
Raw Normal View History

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:
- include: handlers/main.yml
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
include: tasks/variable_loader_common.yml
2020-12-10 19:26:11 +00:00
- name: Configure SSH
2020-12-11 07:39:15 +00:00
include: tasks/ssh_config.yml
2020-12-10 07:33:09 +00:00
2020-12-10 19:59:59 +00:00
- name: Configure harden settings
include: tasks/harden.yml
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