Merge pull request 'feat: create ntp consul service' (#16) from neoloc/ntp_consul_service into develop
Reviewed-on: https://git.query.consul/unkinben/puppet-prod/pulls/16
This commit is contained in:
commit
902e55f655
@ -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
|
||||
|
||||
@ -35,5 +35,13 @@ class profiles::ntp::server (
|
||||
queryhosts => $allowquery,
|
||||
}
|
||||
}
|
||||
|
||||
file {'/usr/local/bin/check_ntp.sh':
|
||||
ensure => 'file',
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0644',
|
||||
content => template('profiles/ntp/check_ntp.sh.erb'),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user