From 604e581a970c3565f18af5a072c402fe9d374f86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alin=20Tr=C4=83istaru?= Date: Sun, 5 Apr 2020 09:42:52 +0300 Subject: [PATCH] add ntpd defaults --- roles/matrix-base/defaults/main.yml | 3 +++ roles/matrix-base/tasks/server_base/setup.yml | 4 ++-- roles/matrix-base/tasks/server_base/setup_archlinux.yml | 2 +- roles/matrix-base/tasks/server_base/setup_centos.yml | 2 +- roles/matrix-base/tasks/server_base/setup_debian.yml | 2 +- roles/matrix-base/tasks/server_base/setup_raspbian.yml | 2 +- 6 files changed, 9 insertions(+), 6 deletions(-) diff --git a/roles/matrix-base/defaults/main.yml b/roles/matrix-base/defaults/main.yml index 6800df86..c6ed430b 100644 --- a/roles/matrix-base/defaults/main.yml +++ b/roles/matrix-base/defaults/main.yml @@ -33,6 +33,9 @@ matrix_systemd_path: "/etc/systemd/system" matrix_cron_path: "/etc/cron.d" matrix_local_bin_path: "/usr/local/bin" +matrix_ntpd_package: "ntp" +matrix_ntpd_service: "{{ 'ntpd' if ansible_os_family == 'RedHat' or ansible_distribution == 'Archlinux' else 'ntp' }}" + matrix_homeserver_url: "https://{{ matrix_server_fqn_matrix }}" matrix_identity_server_url: ~ diff --git a/roles/matrix-base/tasks/server_base/setup.yml b/roles/matrix-base/tasks/server_base/setup.yml index 73abbec2..2425c82b 100644 --- a/roles/matrix-base/tasks/server_base/setup.yml +++ b/roles/matrix-base/tasks/server_base/setup.yml @@ -18,8 +18,8 @@ state: started enabled: yes -- name: Ensure ntpd is started and autoruns +- name: "Ensure {{ matrix_ntpd_service }} is started and autoruns" service: - name: "{{ 'ntpd' if ansible_os_family == 'RedHat' or ansible_distribution == 'Archlinux' else 'ntp' }}" + name: "{{ matrix_ntpd_service }}" state: started enabled: yes diff --git a/roles/matrix-base/tasks/server_base/setup_archlinux.yml b/roles/matrix-base/tasks/server_base/setup_archlinux.yml index 144e8b75..3814305d 100644 --- a/roles/matrix-base/tasks/server_base/setup_archlinux.yml +++ b/roles/matrix-base/tasks/server_base/setup_archlinux.yml @@ -4,7 +4,7 @@ pacman: name: - python-docker - - ntp + - "{{ matrix_ntpd_package }}" # TODO This needs to be verified. Which version do we need? - fuse3 - python-dnspython diff --git a/roles/matrix-base/tasks/server_base/setup_centos.yml b/roles/matrix-base/tasks/server_base/setup_centos.yml index 945c86ef..77b2866a 100644 --- a/roles/matrix-base/tasks/server_base/setup_centos.yml +++ b/roles/matrix-base/tasks/server_base/setup_centos.yml @@ -21,7 +21,7 @@ yum: name: - docker-python - - ntp + - "{{ matrix_ntpd_package }}" - fuse state: latest update_cache: yes diff --git a/roles/matrix-base/tasks/server_base/setup_debian.yml b/roles/matrix-base/tasks/server_base/setup_debian.yml index 9438a5f4..c54b3cb6 100644 --- a/roles/matrix-base/tasks/server_base/setup_debian.yml +++ b/roles/matrix-base/tasks/server_base/setup_debian.yml @@ -28,7 +28,7 @@ apt: name: - "python{{'3' if ansible_python.version.major == 3 else ''}}-docker" - - ntp + - "{{ matrix_ntpd_package }}" - fuse state: latest update_cache: yes diff --git a/roles/matrix-base/tasks/server_base/setup_raspbian.yml b/roles/matrix-base/tasks/server_base/setup_raspbian.yml index 3a62a5db..a9a5d20a 100644 --- a/roles/matrix-base/tasks/server_base/setup_raspbian.yml +++ b/roles/matrix-base/tasks/server_base/setup_raspbian.yml @@ -28,7 +28,7 @@ apt: name: - python-docker - - ntp + - "{{ matrix_ntpd_package }}" - fuse state: latest update_cache: yes