diff --git a/defaults/main.yml b/defaults/main.yml index b588e1b..d98a72d 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,13 +1,13 @@ --- -#chrony_ntpservers: -# - 0.centos.pool.ntp.org -# - 1.centos.pool.ntp.org -# - 2.centos.pool.ntp.org -# - 3.centos.pool.ntp.org +# chrony_ntpservers: +# - 0.centos.pool.ntp.org +# - 1.centos.pool.ntp.org +# - 2.centos.pool.ntp.org +# - 3.centos.pool.ntp.org chrony_ntppools: - 1.pool.ntp.org - 2.pool.ntp.org - 3.pool.ntp.org chrony_allowclients: false -#chrony_clients: -# - 192.168.0.0/24 +# chrony_clients: +# - 192.168.0.0/24 diff --git a/handlers/main.yml b/handlers/main.yml index 5dcd0c8..fe3334e 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -1,4 +1,5 @@ --- - name: Restart chronyd - service: name="chronyd" state=restarted - + ansible.builtin.service: + name: "chronyd" + state: restarted diff --git a/meta/main.yml b/meta/main.yml index 7e9a91c..aae460c 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -6,11 +6,13 @@ galaxy_info: galaxy_tags: [] license: GPL2 platforms: - - name: CentOS - version: - - 7 - - 8 - - name: RedHat - version: - - 7 - - 8 + - name: CentOS + version: + - 7 + - 8 + - 9 + - name: RedHat + version: + - 7 + - 8 + - 9 diff --git a/tasks/main.yml b/tasks/main.yml index eb0ea37..8c5e713 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -3,14 +3,14 @@ include_vars: "{{ ansible_os_family }}.yml" - name: Install chrony packages - package: + ansible.builtin.package: name: "{{ chrony_packages_name }}" state: present - update_cache: yes + update_cache: true notify: Restart chronyd - name: Deploy chronyd configuration - template: + ansible.builtin.template: src: chrony.conf.j2 dest: /etc/chrony.conf owner: root @@ -19,12 +19,12 @@ notify: Restart chronyd - name: Enable chronyd on boot - service: + ansible.builtin.service: name: chronyd - enabled: yes + enabled: true - name: Open Firewalld - firewalld: + ansible.posix.firewalld: service: ntp permanent: true state: enabled diff --git a/vars/RedHat.yml b/vars/RedHat.yml index 6bc8c6a..37dc4c8 100644 --- a/vars/RedHat.yml +++ b/vars/RedHat.yml @@ -1,4 +1,3 @@ --- chrony_packages_name: - chrony -