mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2026-02-09 16:53:39 +01:00
Add NTP
This commit is contained in:
11
salt/ntp/chrony.conf
Normal file
11
salt/ntp/chrony.conf
Normal 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
|
||||||
3
salt/ntp/config.map.jinja
Normal file
3
salt/ntp/config.map.jinja
Normal 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
4
salt/ntp/defaults.yaml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
ntp:
|
||||||
|
servers:
|
||||||
|
- 0.pool.ntp.org
|
||||||
|
- 1.pool.ntp.org
|
||||||
19
salt/ntp/init.sls
Normal file
19
salt/ntp/init.sls
Normal 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
4
salt/ntp/soc_ntp.yaml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
ntp:
|
||||||
|
servers:
|
||||||
|
description: NTP Server List
|
||||||
|
title: NTP Servers
|
||||||
Reference in New Issue
Block a user