Configure the ntpd.conf file and bump version

This commit is contained in:
Jérémy Dubois 2021-07-19 15:25:17 +02:00
parent b1aa50a717
commit 7046e193e0
7 changed files with 44 additions and 5 deletions

View file

@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [6.9.1] - 2021-07-19
### Added
- Configure the ntpd.conf file
## [6.9.0] - 2021-05-06
### Changed

View file

@ -1,4 +1,4 @@
# EvoBSD 6.9.0
# EvoBSD 6.9.1
EvoBSD is an ansible project used for customising OpenBSD hosts
used by Evolix.

View file

@ -1,6 +1,5 @@
---
ntpd_servers:
- "ntp.evolix.net"
ntpd_servers: "ntp.evolix.net"
general_alert_email: "root@localhost"
general_technical_realm: "example.com"

View file

@ -31,3 +31,8 @@
command: mount -u -o noatime /home
args:
warn: false
- name: reload ntp
service:
name: ntpd
state: restarted

View file

@ -10,3 +10,4 @@
- include: newsyslog.yml
- include: cron.yml
- include: fstab.yml
- include: ntp.yml

29
roles/base/tasks/ntp.yml Normal file
View file

@ -0,0 +1,29 @@
---
- name: Retrieve ntpd.conf content
command: cat ntpd.conf
args:
chdir: /etc/
register: ntpd_conf
tags:
- ntp
- name: Empty ntpd.conf before customizing it
file:
path: /etc/ntpd.conf
state: absent
when: ntpd_conf.stdout is not regex("^server ntp.evolix.net$")
tags:
- ntp
- name: Customize ntpd conf
lineinfile:
path: /etc/ntpd.conf
line: "server {{ ntpd_servers }}"
create: yes
owner: root
group: wheel
mode: '0644'
notify:
- reload ntp
tags:
- ntp

View file

@ -3,8 +3,7 @@
## Edit and uncomment to overwrite the default values ##
########################################################
# ntpd_servers:
# - "ntp.evolix.net"
# ntpd_servers: "pool.ntp.org"
#
# general_alert_email: "root@localhost"
# general_technical_realm: "example.com"