]> git.phdru.name Git - ansible.git/blob - playbooks/roles/ntpdate-hwc/tasks/main.yml
Feat: Rename `adjtimex` -> `ntpdate-hwc`
[ansible.git] / playbooks / roles / ntpdate-hwc / tasks / main.yml
1 - name: Install adjtimex, ntpdate-debian and hwclock
2   become: true
3   apt:
4     autoclean: yes
5     autoremove: yes
6     cache_valid_time: 3600
7     install_recommends: no
8     # Install adjtimex, ntpdate-debian and hwclock
9     name: ['adjtimex', 'ntpdate', 'util-linux']
10     state: latest
11     update_cache: yes
12   when: ansible_facts.os_family == 'Debian'
13
14 - name: Remove ntpd
15   become: true
16   apt:
17     name: ntp
18     state: absent
19     update_cache: no
20   when: ansible_facts.os_family == 'Debian'
21
22 - name: Install adjtimex, ntpdate and hwclock
23   become: true
24   dnf:
25     # Install adjtimex, ntpdate-debian and hwclock
26     name: ['adjtimex', 'ntpdate', 'util-linux']
27     state: latest
28     update_cache: yes
29   when: ansible_facts.os_family == 'RedHat'
30
31 - name: Copy the script ntpdate-hwc
32   become: true
33   template:
34     src: ntpdate-hwc
35     dest: /usr/local/sbin/ntpdate-hwc
36     owner: root
37     group: root
38     mode: 0750
39
40 - name: Configure ntpdate-hwc weekly run
41   become: true
42   copy:
43     src: ntpdate-hwc
44     dest: /etc/cron.weekly
45     owner: root
46     group: root
47     mode: '0700'