This commit is contained in:
Mike Reeves
2022-09-19 14:06:30 -04:00
parent 32034078fa
commit f7e614f358
5 changed files with 41 additions and 0 deletions

11
salt/ntp/chrony.conf Normal file
View File

@@ -0,0 +1,11 @@
# NTP server list
{% for SERVER in NTPCONFIG.ntp.servers %}
server {{ SERVER }} iburst
{% endfor %}
# Config options
driftfile /var/lib/chrony/drift
makestep 1.0 3
rtcsync
logdir /var/log/chrony

View File

@@ -0,0 +1,3 @@
{% import_yaml 'ntp/defaults.yaml' as NTP with context %}
{% set NTPCONFIG = salt['pillar.get']('ntp', default=NTP, merge=True) %}

4
salt/ntp/defaults.yaml Normal file
View File

@@ -0,0 +1,4 @@
ntp:
servers:
- 0.pool.ntp.org
- 1.pool.ntp.org

19
salt/ntp/init.sls Normal file
View File

@@ -0,0 +1,19 @@
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
# https://securityonion.net/license; you may not use this file except in compliance with the
# Elastic License 2.0.
{% from 'ntp/config.map.jinja' import NTPCONFIG %}
chronyconf:
file.managed:
- name: /etc/chrony.conf
- source: salt://ntp/chrony.conf
- template: jinja
- defaults:
- NTPCONFIG: {{ NTPCONFIG.ntp }}
chronyd:
service.running:
- enable: True
- watch:
- file: chronyconf

4
salt/ntp/soc_ntp.yaml Normal file
View File

@@ -0,0 +1,4 @@
ntp:
servers:
description: NTP Server List
title: NTP Servers