36 lines
912 B
YAML
36 lines
912 B
YAML
|
---
|
||
|
#
|
||
|
# Example ansible playbook for timezone and NTP setup on AIX.
|
||
|
# A reboot is required for the timezone change.
|
||
|
#
|
||
|
# ansible-galaxy collection install community.general
|
||
|
# ansible-playbook -i aixhost, -k -u root timezone-aix.yml
|
||
|
#
|
||
|
|
||
|
- name: "Install / Configure sysmon client and plugins"
|
||
|
hosts: all
|
||
|
gather_facts: yes
|
||
|
vars:
|
||
|
timezone: Europe/Copenhagen
|
||
|
ntp_server: dk.pool.ntp.org
|
||
|
|
||
|
tasks:
|
||
|
|
||
|
- name: Configure timezone
|
||
|
ansible.builtin.replace:
|
||
|
path: /etc/environment
|
||
|
regexp: '^TZ=(.*)$'
|
||
|
replace: "TZ={{ timezone }}"
|
||
|
|
||
|
- name: Update time from NTP server
|
||
|
ansible.builtin.command: /usr/sbin/ntpdate {{ ntp_server }}
|
||
|
|
||
|
- name: Create cron entry for updating time periodically
|
||
|
ansible.builtin.cron:
|
||
|
name: ntpdate
|
||
|
weekday: "*"
|
||
|
minute: "1"
|
||
|
hour: "*"
|
||
|
user: root
|
||
|
job: "/usr/sbin/ntpdate {{ ntp_server }}"
|