forked from kgodden/query_ntp_status
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdeploy_ntp_query.yml
43 lines (38 loc) · 1.16 KB
/
deploy_ntp_query.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
- name: Deploy NTP Query Tool
hosts: all
tasks:
- name: Create tool directory
ansible.builtin.file:
path: /opt/ntp_query_tool
state: 'directory'
mode: '0755'
- name: Create tool log directory
ansible.builtin.file:
path: /var/log/ntpqt
state: 'directory'
mode: '0755'
- name: Drop in ntp query script
ansible.builtin.copy:
src: query_ntp_status.py
dest: /opt/ntp_query_tool/query_ntp_status.py
owner: root
group: root
mode: '0755'
- name: Drop in logrotate config
ansible.builtin.copy:
src: logrotate-ntpqt
dest: /etc/logrotate.d/ntpqt
owner: root
group: root
mode: 0644
- name: Drop in filebeat config
ansible.builtin.copy:
src: filebeat-ntpqt.yml
dest: /etc/filebeat/conf.d/ntpqt.yml
owner: root
group: root
mode: 0644
- name: Configure cron task
ansible.builtin.cron:
name: "Run ntpqt"
job: "export PATH=$PATH:/usr/bin:/usr/sbin/; {{ ansible_python.executable }} /opt/ntp_query_tool/query_ntp_status.py >> /var/log/ntpqt/ntpqt.log 2>&1"