add options to setup ucs ntp

This commit is contained in:
Robert Kaussow 2018-11-19 23:48:15 +01:00
parent 93418fb98a
commit 7036312f8d
4 changed files with 32 additions and 1 deletions

View File

@ -5,3 +5,6 @@ ntp_servers:
- "server 2.pool.ntp.org" - "server 2.pool.ntp.org"
- "server 3.pool.ntp.org" - "server 3.pool.ntp.org"
ntp_timezone: Europe/Berlin ntp_timezone: Europe/Berlin
# Varaiables only used on UCS systems
ntp_signed_requests: yes

View File

@ -1,2 +1,10 @@
--- ---
- import_tasks: install.yml - import_tasks: setup_default.yml
when:
- common_sshd_configuration_enabled
- not ansible_lsb.id is defined or not ansible_lsb.id == "Univention"
- include_tasks: setup_ucs.yml
when:
- common_sshd_configuration_enabled
- ansible_lsb.id is defined
- ansible_lsb.id == "Univention"

20
tasks/setup_ucs.yml Normal file
View File

@ -0,0 +1,20 @@
---
- block:
- name: Configure ntp servers
ucr:
path: "{{ item.path }}"
value: "{{ item.value }}"
with_items:
- { path: timeserver, value: "{{ ntp_servers[0] | default('') }}" }
- { path: timeserver2, value: "{{ ntp_servers[1] | default('') }}" }
- { path: timeserver3, value: "{{ ntp_servers[2] | default('') }}" }
loop_control:
label: "variable: {{ item.path }}={{ item.value }}"
notify: __ntpd_restart
- name: Configure signed ntp time requests
ucr:
path: "ntp/signed"
value: "{{ ntp_signed_requests }}"
become: True
become_user: root