Changed /etc/localtime to link and made some clean up to time::zone class.
This commit is contained in:
parent
80fdca2f9b
commit
deb2e7eafa
1 changed files with 13 additions and 9 deletions
|
@ -16,29 +16,33 @@ class time::server {
|
|||
# for example $timezone_set = "Europe/Helsinki".
|
||||
class time::zone {
|
||||
file { "/etc/localtime":
|
||||
ensure => present,
|
||||
mode => "0644",
|
||||
source => "/usr/share/zoneinfo/$timezone_set"
|
||||
ensure => link,
|
||||
target => "/usr/share/zoneinfo/${timezone_set}",
|
||||
owner => "root",
|
||||
group => $::operatingsystem ? {
|
||||
"openbsd" => "wheel",
|
||||
default => "root",
|
||||
},
|
||||
}
|
||||
|
||||
case $operatingsystem {
|
||||
centos,redhat: {
|
||||
"centos","redhat": {
|
||||
file { "/etc/sysconfig/clock":
|
||||
ensure => present,
|
||||
mode => "0644",
|
||||
content => template("time/sysconfig_clock.erb"),
|
||||
}
|
||||
}
|
||||
ubuntu: {
|
||||
"ubuntu": {
|
||||
file { "/etc/timezone":
|
||||
ensure => present,
|
||||
mode => "0644",
|
||||
content => "$timezone_set\n",
|
||||
content => "${timezone_set}\n",
|
||||
}
|
||||
}
|
||||
openbsd: { } # file /etc/localtime is enough
|
||||
default: {
|
||||
fail("time::zone not supported on ${operatingsystem}")
|
||||
"openbsd": { } # file /etc/localtime is enough
|
||||
"default": {
|
||||
fail("time::zone not supported on ${::operatingsystem}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue