Skip to content

Instantly share code, notes, and snippets.

@ianblenke
Created January 21, 2015 23:48
Show Gist options
  • Save ianblenke/63e76bac920575222b5a to your computer and use it in GitHub Desktop.
Save ianblenke/63e76bac920575222b5a to your computer and use it in GitHub Desktop.
An NTP cloud-init for coreos
#cloud-config
coreos:
units:
- name: settimezone.service
command: start
content: |
[Unit]
Description=Set the timezone
[Service]
ExecStart=/usr/bin/timedatectl set-timezone UTC ; /usr/bin/timedatectl set-ntp true
RemainAfterExit=yes
Type=oneshot
write_files:
- path: /etc/ntp.conf
content: |
# Common pool
server 0.pool.ntp.org
server 1.pool.ntp.org
server 2.pool.ntp.org
server 3.pool.ntp.org
# - Allow only time queries, at a limited rate.
# - Allow all local queries (IPv4, IPv6)
restrict default nomodify nopeer noquery limited kod
restrict 127.0.0.1
restrict [::1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment