Skip to content
Snippets Groups Projects
Commit 628e6533 authored by nimrod's avatar nimrod
Browse files

- Removed NTP client, moved to a seperate role.

parent a7da5085
No related branches found
No related tags found
No related merge requests found
...@@ -28,7 +28,6 @@ Role Variables ...@@ -28,7 +28,6 @@ Role Variables
collectd_riemann_server: collectd_riemann_server:
collectd_collectd_server: collectd_collectd_server:
collectd_statsd_server: collectd_statsd_server:
ntp:
unattended_upgrades: unattended_upgrades:
tls_cert: # Filename of the TLS cert for that host. tls_cert: # Filename of the TLS cert for that host.
tls_key: # Filename of the TLS key for that host. tls_key: # Filename of the TLS key for that host.
...@@ -84,7 +83,6 @@ TODO ...@@ -84,7 +83,6 @@ TODO
- Implement: - Implement:
- collectd_agent. - collectd_agent.
- ldap_login (with pam_mkhomedir).
- ssh_ca. - ssh_ca.
- syslog_forwarding. - syslog_forwarding.
- Test. - Test.
......
...@@ -18,13 +18,3 @@ ...@@ -18,13 +18,3 @@
service: service:
name: collectd name: collectd
state: restarted state: restarted
- name: Restart ntpd
service:
name: '{{ ntpd_service[ansible_os_family] }}'
state: restarted
- name: Restart systemd-timesyncd
service:
name: systemd-timesyncd
state: restarted
...@@ -29,9 +29,6 @@ ...@@ -29,9 +29,6 @@
- include: collectd_agent.yml - include: collectd_agent.yml
when: (collectd_graphite_server is defined or collectd_riemann_server is defined or collectd_collectd_server is defined or collectd_statsd_server is defined) and not common_role_finished is defined when: (collectd_graphite_server is defined or collectd_riemann_server is defined or collectd_collectd_server is defined or collectd_statsd_server is defined) and not common_role_finished is defined
- include: ntp.yml
when: ntp|default(True) and not common_role_finished is defined
- include: unattended_upgrades.yml - include: unattended_upgrades.yml
when: unattended_upgrades|default(True) and ansible_os_family == 'Debian' and not common_role_finished is defined when: unattended_upgrades|default(True) and ansible_os_family == 'Debian' and not common_role_finished is defined
......
---
- name: Assert
assert:
that: ansible_os_family in [ 'Debian', 'OpenBSD' ]
- include: ntpd.yml
when: ansible_service_mgr in [ ]
- include: systemd-timesyncd.yml
when: ansible_service_mgr == 'systemd'
---
- assert:
that: ansible_os_family in [ 'Debian', 'OpenBSD' ]
- name: apt install ntpd
when: ansible_pkg_mgr == 'apt'
apt:
name: ntp
state: present
update_cache: yes
cache_valid_time: 3600
- name: Configure ntpd
template:
src: ntpd.conf.j2
dest: '{{ ntpd_conf[ansible_os_family] }}'
owner: root
group: 0
mode: 0o0644
notify:
- Restart ntpd
- name: Enable ntpd
service:
name: '{{ ntpd_service[ansible_os_family] }}'
enabled: yes
state: started
---
- name: Configure systemd-timesyncd
lineinfile:
dest: /etc/systemd/timesyncd.conf
line: 'NTP=0.debian.pool.ntp.org 1.debian.pool.ntp.org 2.debian.pool.ntp.org 3.debian.pool.ntp.org'
regexp: '^NTP='
state: present
notify:
- 'Restart systemd-timesyncd'
- name: Enable systemd-timesyncd
service:
name: systemd-timesyncd
enabled: yes
state: started
{% for i in range(4) %}
server {{ i }}.{{ ntp_pool[ansible_os_family] }}
{% endfor %}
...@@ -32,15 +32,3 @@ update_ca_certificates: ...@@ -32,15 +32,3 @@ update_ca_certificates:
cert_dir: cert_dir:
OpenBSD: /etc/ssl/certs OpenBSD: /etc/ssl/certs
Debian: /usr/local/share/ca-certificates Debian: /usr/local/share/ca-certificates
ntpd_conf:
OpenBSD: /etc/ntpd.conf
Debian: /etc/ntp.conf
ntp_pool:
OpenBSD: pool.ntp.org
Debian: debian.pool.ntp.org
ntpd_service:
OpenBSD: ntpd
Debian: ntp
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment