Skip to content

Instantly share code, notes, and snippets.

@andredumas
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andredumas/9612907 to your computer and use it in GitHub Desktop.
Save andredumas/9612907 to your computer and use it in GitHub Desktop.
Online note of a manifest I regularly use to set date, time and timezone information on ubuntu hosts. Works on vagrant box precise64 (http://files.vagrantup.com/precise64.box) and AWS EC2 Ubuntu instances.
# Make sure you apt-get update before applying this.
package { "language-pack-en":
ensure => latest
}
package { "tzdata":
ensure => latest
}
file { "/etc/localtime":
ensure => "/usr/share/zoneinfo/Australia/Melbourne",
require => Package["tzdata"]
}
file { "/etc/timezone":
content => "Australia/Melbourne\n",
require => Package["tzdata"]
}
exec { "/usr/sbin/dpkg-reconfigure --frontend noninteractive tzdata":
require => File["/etc/timezone"],
refreshonly => true,
subscribe => [ Package["tzdata"], File["/etc/timezone"] ]
}
exec { "/usr/sbin/locale-gen en_AU.UTF-8":
refreshonly => true,
require => Package["language-pack-en"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment