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/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: