1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_ntp.git synced 2024-08-16 12:59:49 +02:00

Merge pull request #5 from roles-ansible/tz

create option to manage timezones
This commit is contained in:
L3D 2022-11-17 00:03:42 +01:00 committed by GitHub
commit 8d330190c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 22 additions and 15 deletions

View file

@ -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.

View file

@ -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

View file

@ -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

5
tasks/set_time_zone.yml Normal file
View file

@ -0,0 +1,5 @@
---
- name: "Set timezone to {{ ntp_timezone }}"
become: true
community.general.timezone:
name: "{{ ntp_timezone }}"

View file

@ -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 %}

View file

@ -1,5 +1,5 @@
---
playbook_version_number: 2054
playbook_version_number: 2055
playbook_version_path: 'role-ntp_chaos-bodensee_github.com.version'
ntp__vars: