From f509888d5fadd49be1a8c6a3e605d9ffc07b20d1 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sun, 8 Jan 2023 10:05:39 +0300 Subject: [PATCH] Feat: Switch from `adjtimex`/`hwclock` back to `ntpd` --- playbooks/roles/init-system/tasks/apt.yaml | 2 +- playbooks/roles/ntpdate-hwc/files/ntpdate-hwc | 2 - playbooks/roles/ntpdate-hwc/tasks/main.yaml | 47 ------------------- .../roles/ntpdate-hwc/templates/ntpdate-hwc | 17 ------- 4 files changed, 1 insertion(+), 67 deletions(-) delete mode 100755 playbooks/roles/ntpdate-hwc/files/ntpdate-hwc delete mode 100644 playbooks/roles/ntpdate-hwc/tasks/main.yaml delete mode 100755 playbooks/roles/ntpdate-hwc/templates/ntpdate-hwc diff --git a/playbooks/roles/init-system/tasks/apt.yaml b/playbooks/roles/init-system/tasks/apt.yaml index 65f61d6..26640db 100644 --- a/playbooks/roles/init-system/tasks/apt.yaml +++ b/playbooks/roles/init-system/tasks/apt.yaml @@ -31,7 +31,7 @@ install_recommends: no name: ['avahi-autoip', 'bluetooth', 'bluez', 'debian-faq', 'doc-debian', 'emacsen-comm', - 'ntp', 'vim-tiny', + 'vim-tiny', ] purge: yes state: absent diff --git a/playbooks/roles/ntpdate-hwc/files/ntpdate-hwc b/playbooks/roles/ntpdate-hwc/files/ntpdate-hwc deleted file mode 100755 index c86e368..0000000 --- a/playbooks/roles/ntpdate-hwc/files/ntpdate-hwc +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -exec /usr/local/sbin/ntpdate-hwc diff --git a/playbooks/roles/ntpdate-hwc/tasks/main.yaml b/playbooks/roles/ntpdate-hwc/tasks/main.yaml deleted file mode 100644 index bf7acc4..0000000 --- a/playbooks/roles/ntpdate-hwc/tasks/main.yaml +++ /dev/null @@ -1,47 +0,0 @@ -- name: Install adjtimex, ntpdate-debian and hwclock - become: true - apt: - autoclean: yes - autoremove: yes - cache_valid_time: 3600 - install_recommends: no - # Install adjtimex, ntpdate-debian and hwclock - name: ['adjtimex', 'ntpdate', 'util-linux'] - state: latest - update_cache: yes - when: ansible_facts.os_family == 'Debian' - -- name: Remove ntpd - become: true - apt: - name: ntp - state: absent - update_cache: no - when: ansible_facts.os_family == 'Debian' - -- name: Install adjtimex, ntpdate and hwclock - become: true - dnf: - # Install adjtimex, ntpdate-debian and hwclock - name: ['adjtimex', 'ntpdate', 'util-linux'] - state: latest - update_cache: yes - when: ansible_facts.os_family == 'RedHat' - -- name: Copy the script ntpdate-hwc - become: true - template: - src: ntpdate-hwc - dest: /usr/local/sbin/ntpdate-hwc - owner: root - group: root - mode: 0750 - -- name: Configure ntpdate-hwc weekly run - become: true - copy: - src: ntpdate-hwc - dest: /etc/cron.weekly - owner: root - group: root - mode: '0700' diff --git a/playbooks/roles/ntpdate-hwc/templates/ntpdate-hwc b/playbooks/roles/ntpdate-hwc/templates/ntpdate-hwc deleted file mode 100755 index 6d97e51..0000000 --- a/playbooks/roles/ntpdate-hwc/templates/ntpdate-hwc +++ /dev/null @@ -1,17 +0,0 @@ -#! /bin/sh - -# Warm up DNS -host -t ns pool.ntp.org -host pool.ntp.org -{% if ansible_facts.os_family == 'Debian' %} -host 0.debian.pool.ntp.org -host 1.debian.pool.ntp.org -host 2.debian.pool.ntp.org -host 3.debian.pool.ntp.org -{% endif %} - -ntpdate{% if ansible_facts.os_family == 'Debian' %}-debian{% endif %} -b && -hwclock --systohc --update-drift && - -hwclock --get && -exec date -- 2.39.2