2020-12-14 03:49:57 +00:00
|
|
|
---
|
|
|
|
# Sets Up Chrony Server/Client
|
|
|
|
# Created: @derekmpage
|
|
|
|
# Kudos: @danielkubat @Darkbat91
|
2020-12-14 06:57:25 +00:00
|
|
|
# Fixes: @nazunalika
|
2020-12-14 04:04:42 +00:00
|
|
|
- name: Rocky Chrony Runbook
|
2020-12-14 03:49:57 +00:00
|
|
|
hosts: all
|
|
|
|
become: true
|
2020-12-14 06:57:25 +00:00
|
|
|
vars_files:
|
|
|
|
- vars/chrony.yml
|
|
|
|
|
|
|
|
# This is to try to avoid the handler issue in pre/post tasks
|
|
|
|
handlers:
|
|
|
|
- import_tasks: handlers/main.yml
|
|
|
|
|
|
|
|
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-14 03:49:57 +00:00
|
|
|
|
|
|
|
tasks:
|
|
|
|
- name: Configure Chrony
|
|
|
|
import_tasks: tasks/chrony.yml
|
2020-12-14 06:57:25 +00:00
|
|
|
|
|
|
|
post_tasks:
|
|
|
|
- name: Touching run file that ansible has ran here
|
|
|
|
file:
|
|
|
|
path: /var/log/ansible.run
|
|
|
|
state: touch
|
|
|
|
mode: '0644'
|
|
|
|
owner: root
|
|
|
|
group: root
|