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

35 lines
816 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
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
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