diff --git a/roles/edpm_chrony/README.rst b/roles/edpm_chrony/README.rst deleted file mode 100644 index 885e08fc4..000000000 --- a/roles/edpm_chrony/README.rst +++ /dev/null @@ -1,111 +0,0 @@ -chrony -====== - -A role to manage chrony - -Role Variables --------------- - -.. list-table:: Variables used for chrony - :widths: auto - :header-rows: 1 - - * - Name - - Default Value - - Description - * - `edpm_chrony_role_action` - - `all` - - Ansible action when including the role. Should be one of: [all|install|config|upgrade|online] - * - `edpm_chrony_package_name` - - `chrony` - - chrony system package name - * - `edpm_chrony_service_name` - - `chronyd` - - chrony system service name - * - `edpm_chrony_manage_service` - - `True` - - Flag used to specific if the ansible role should manage the service - * - `edpm_chrony_manage_package` - - `True` - - Flag used to specific if the ansible role should manage the package - * - `edpm_chrony_service_state` - - `started` - - Default service state to configure (started|stopped) - * - `edpm_chrony_config_file_location` - - `/etc/chrony.conf` - - Chrony configuration file location. - * - `edpm_chrony_driftfile_path` - - `/var/lib/chrony/drift` - - Chrony drift file location - * - `edpm_chrony_logdir_path` - - `/var/log/chrony` - - Chrony log directory location - * - `edpm_chrony_ntp_servers` - - `[]` - - List of NTP servers. This can be a list of hashes for advanced configuration. - If using the hash format, a `server_name` and `server_settings` key should be populated with - the appropriate data. If this is a list of hostnames, the `edpm_chrony_global_server_settings` - will be appended to the configuration. - * - `edpm_chrony_global_server_settings` - - `` - - Default setting to apply to the servers configuration - * - `edpm_chrony_ntp_pools` - - `[]` - - List of NTP pools. This can be a list of hashes for advanced configuration. - If using the hash format, a `pool_name` and `pool_settings` key should be populated with - the appropriate data. If this is a list of hostnames, the `edpm_chrony_global_pool_settings` - will be appended to the configuration. - * - `edpm_chrony_global_pool_settings` - - `` - - Default setting to apply to the pools configuration - * - `edpm_chrony_ntp_peers` - - `[]` - - List of NTP peers. This can be a list of hashes for advanced configuration. - If using the hash format, a `peer_name` and `peer_settings` key should be populated with - the appropriate data. If this is a list of hostnames, the `edpm_chrony_global_peer_settings` - will be appended to the configuration. - * - `edpm_chrony_global_peer_settings` - - `` - - Default setting to apply to the peers configuration - * - `edpm_chrony_bind_addresses` - - `['127.0.0.1', '::1']` - - List of addresses to bind to to listen for command packets - * - `edpm_chrony_acl_rules` - - `[]` - - List of specific allow/deny commands for the configuration file - * - `edpm_chrony_rtc_settings` - - `['rtcsync']` - - List of specific real time lock settings - * - `edpm_chrony_makestep` - - `1.0 3` - - The chrony makestep configuration - * - `edpm_chrony_extra_options` - - `[]` - - A list of extra option strings that is added to the end of the configuration file. This list is joined with new lines. - - -Requirements ------------- - - - ansible >= 2.9 - - python >= 2.6 - -Dependencies ------------- - -None - -Example Playbooks ------------------ - -.. code-block:: - - - hosts: localhost - become: true - roles: - - chrony - -License -------- - -Apache 2.0 diff --git a/roles/edpm_chrony/tasks/config.yml b/roles/edpm_chrony/tasks/config.yml index 88cb9be53..aa6f0d013 100644 --- a/roles/edpm_chrony/tasks/config.yml +++ b/roles/edpm_chrony/tasks/config.yml @@ -21,6 +21,6 @@ dest: "{{ edpm_chrony_config_file_location }}" owner: root group: root - mode: 0644 + mode: '0644' register: edpm_chrony_config notify: Restart chronyd diff --git a/roles/edpm_chrony/tasks/online.yml b/roles/edpm_chrony/tasks/online.yml index 32501caad..fa1c44451 100644 --- a/roles/edpm_chrony/tasks/online.yml +++ b/roles/edpm_chrony/tasks/online.yml @@ -4,7 +4,7 @@ ansible.builtin.copy: src: files/chrony-online.service dest: /etc/systemd/system/chrony-online.service - mode: 0644 + mode: '0644' - name: Enable chrony-online.service become: true diff --git a/roles/edpm_chrony/tasks/sync.yml b/roles/edpm_chrony/tasks/sync.yml index e6e0e404d..a8e81999e 100644 --- a/roles/edpm_chrony/tasks/sync.yml +++ b/roles/edpm_chrony/tasks/sync.yml @@ -18,6 +18,12 @@ - name: Force NTP sync become: true ansible.builtin.command: chronyc makestep + register: _makestep_command_output + changed_when: _makestep_command_output.rc == 0 + failed_when: _makestep_command_output.rc != 0 - name: Ensure system is NTP time synced ansible.builtin.command: chronyc waitsync 30 + register: _waitsync_command_output + changed_when: _waitsync_command_output.rc == 0 + failed_when: _waitsync_command_output.rc != 0 diff --git a/roles/edpm_chrony/tests/all.yml b/roles/edpm_chrony/tests/all.yml deleted file mode 100644 index d66712910..000000000 --- a/roles/edpm_chrony/tests/all.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -- hosts: all - gather_facts: true - become: true - vars: - edpm_chrony_role_action: all - roles: - - chrony diff --git a/roles/edpm_chrony/tests/config.yml b/roles/edpm_chrony/tests/config.yml deleted file mode 100644 index 74f5a2803..000000000 --- a/roles/edpm_chrony/tests/config.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -- hosts: all - gather_facts: true - become: true - vars: - edpm_chrony_role_action: config - roles: - - chrony diff --git a/roles/edpm_chrony/tests/install.yml b/roles/edpm_chrony/tests/install.yml deleted file mode 100644 index 737460cc5..000000000 --- a/roles/edpm_chrony/tests/install.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -- hosts: all - gather_facts: true - become: true - vars: - edpm_chrony_role_action: install - roles: - - chrony diff --git a/roles/edpm_chrony/tests/inventory.yml b/roles/edpm_chrony/tests/inventory.yml deleted file mode 100644 index 9af0787ca..000000000 --- a/roles/edpm_chrony/tests/inventory.yml +++ /dev/null @@ -1,3 +0,0 @@ -all: - hosts: - localhost diff --git a/roles/edpm_chrony/tests/upgrade.yml b/roles/edpm_chrony/tests/upgrade.yml deleted file mode 100644 index fc4019d5d..000000000 --- a/roles/edpm_chrony/tests/upgrade.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -- hosts: all - gather_facts: true - become: true - vars: - edpm_chrony_role_action: upgrade - roles: - - chrony