feat: create ntp consul service
- create consul policy for ntp servers - add consul service check and check script
This commit is contained in:
@@ -12,3 +12,24 @@ profiles::ntp::server::peers:
|
||||
- '1.au.pool.ntp.org'
|
||||
- '2.au.pool.ntp.org'
|
||||
- '3.au.pool.ntp.org'
|
||||
|
||||
consul::services:
|
||||
ntp:
|
||||
service_name: 'ntp'
|
||||
tags:
|
||||
- 'ntp'
|
||||
- 'time'
|
||||
- 'sync'
|
||||
address: "%{facts.networking.ip}"
|
||||
port: 123
|
||||
checks:
|
||||
- id: ntp_check
|
||||
name: "NTP Service Check"
|
||||
args:
|
||||
- '/usr/local/bin/check_ntp.sh'
|
||||
interval: '15s'
|
||||
timeout: '5s'
|
||||
profiles::consul::client::node_rules:
|
||||
- resource: service
|
||||
segment: ntp
|
||||
disposition: write
|
||||
|
||||
@@ -77,3 +77,9 @@ profiles::consul::prepared_query::rules:
|
||||
service_failover_n: 3
|
||||
service_only_passing: true
|
||||
ttl: 10
|
||||
ntp:
|
||||
ensure: 'present'
|
||||
service_name: 'ntp'
|
||||
service_failover_n: 3
|
||||
service_only_passing: true
|
||||
ttl: 10
|
||||
|
||||
Reference in New Issue
Block a user