diff --git a/README.md b/README.md index 21cdd7b..4790853 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,10 @@ ntp_servers: - 2.pool.ntp.org iburst - 3.pool.ntp.org iburst +# optionally set timezone +ntp_set_time_zone: false +ntp_timezone: 'Europe/Berlin' + # Enable or disable ntp statistics ntp_statistics: false @@ -48,15 +52,5 @@ submodules_versioncheck: false This role was created in 2018 by diodonfrost. This role was updated and maintained since 2019 by L3D *([DO1JLR](https://github.com/do1jlr))* -## Testing - -This role is using some github actions for testing. Because systemd operations inside docker containers do not work verry well only linting is tested. -If you have a idea how to improve the testing please leave a comment, create a issue or even better open a pull request. - -We use these actions for testing: - -| Status | Marketplace | -| ------ | ----------- | -| [![Ansible Lint check](https://github.com/roles-ansible/ansible_role_ntp/actions/workflows/ansible-linting-check.yml/badge.svg)](https://github.com/roles-ansible/ansible_role_ntp/actions/workflows/ansible-linting-check.yml) | [ansible-lint](https://github.com/marketplace/actions/ansible-lint) | -| [![Yamllint GitHub Actions](https://github.com/roles-ansible/ansible_role_ntp/actions/workflows/yamllint.yaml/badge.svg)](https://github.com/roles-ansible/ansible_role_ntp/actions/workflows/yamllint.yaml) | [yamllint-github-action](https://github.com/marketplace/actions/yamllint-github-action) | -| [![Galaxy release](https://github.com/roles-ansible/ansible_role_ntp/actions/workflows/galaxy.yml/badge.svg)](https://github.com/roles-ansible/ansible_role_ntp/actions/workflows/galaxy.yml) | [publish-ansible-role-to-galaxy](https://github.com/marketplace/actions/publish-ansible-role-to-galaxy) +## Contribution +Pleas feel free to open a issue or *(even better)* create a Pull Request if there is a problem or you missing a feature or something like that. diff --git a/defaults/main.yml b/defaults/main.yml index 9099a77..3a0edb1 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -21,5 +21,9 @@ ntp_servers: # Enable or disable ntp statistics ntp_statistics: false +# optionally set timezone +ntp_set_time_zone: false +ntp_timezone: 'Europe/Berlin' + # version check for this playbook (true is recomended) submodules_versioncheck: false diff --git a/tasks/main.yml b/tasks/main.yml index 7340420..dae11ac 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -11,3 +11,7 @@ - name: Configure ntp ansible.builtin.include_tasks: config.yml + +- name: Optionally set NTP Timezone + ansible.builtin.include_tasks: set_time_zone.yml + when: ntp_set_time_zone | bool diff --git a/tasks/set_time_zone.yml b/tasks/set_time_zone.yml new file mode 100644 index 0000000..71b6532 --- /dev/null +++ b/tasks/set_time_zone.yml @@ -0,0 +1,5 @@ +--- +- name: "Set timezone to {{ ntp_timezone }}" + become: true + community.general.timezone: + name: "{{ ntp_timezone }}" diff --git a/templates/ntp.conf.j2 b/templates/ntp.conf.j2 index 41c141c..3808ca7 100644 --- a/templates/ntp.conf.j2 +++ b/templates/ntp.conf.j2 @@ -2,10 +2,10 @@ ## ## ## THIS FILE IS MANAGED BY ANSIBLE ## ## ## -## It is about time ## +## It is about time ## ## ## ##################################### - +# > galaxy.ansible.com/do1jlr/ntp < # driftfile {{ ntp_driftfile }} {% for restrict_ip in ntp_restrict %} diff --git a/vars/main.yml b/vars/main.yml index dde0e64..9354ccd 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -1,5 +1,5 @@ --- -playbook_version_number: 2054 +playbook_version_number: 2055 playbook_version_path: 'role-ntp_chaos-bodensee_github.com.version' ntp__vars: