class { '::timezone':
timezone => 'UTC',
}
Notice: /Stage[main]/Timezone/File[/etc/timezone]/content:
--- /etc/timezone 2015-05-20 14:33:55.475440368 +0000
+++ /tmp/puppet-file20150522-18306-1exjari 2015-05-22 11:41:13.662396982 +0000
@@ -1 +1,2 @@
-Etc/UTC
+# Managed by puppet - do not modify
+UTC
Info: Computing checksum on file /etc/timezone
Info: FileBucket got a duplicate file {md5}4f24b133ba38d8fd565168742c9aedeb
Info: /Stage[main]/Timezone/File[/etc/timezone]: Filebucketed /etc/timezone to puppet with sum 4f24b133ba38d8fd565168742c9aedeb
Notice: /Stage[main]/Timezone/File[/etc/timezone]/content: content changed '{md5}4f24b133ba38d8fd565168742c9aedeb' to '{md5}ee3a680deca3b3a0f7667a1a70b093ff'
Info: /Stage[main]/Timezone/File[/etc/timezone]: Scheduling refresh of Exec[update_timezone]
Notice: /Stage[main]/Timezone/Exec[update_timezone]: Triggered 'refresh' from 1 events
Info: Computing checksum on file /etc/localtime
Info: FileBucket got a duplicate file {md5}c79354b8dbee09e62bbc3fb544853283
Info: /Stage[main]/Timezone/File[/etc/localtime]: Filebucketed /etc/localtime to puppet with sum c79354b8dbee09e62bbc3fb544853283
Notice: /Stage[main]/Timezone/File[/etc/localtime]/ensure: ensure changed 'file' to 'link'
Please note UTC -> Etc/UTC change and "file" to "link" change in /etc/localtime.
file { '/etc/timezone':
owner => 'root',
group => 'root',
mode => '0644',
content => "Etc/UTC\n",
}
exec { '/usr/sbin/dpkg-reconfigure -f noninteractive tzdata':
creates => '/etc/localtime',
subscribe => File['/etc/timezone'],
refreshonly => true
}
}
root@TESTHOST:~# dpkg-reconfigure tzdata
Current default time zone: 'Etc/Universal'
Local time is now: Fri May 22 11:49:20 UTC 2015.
Universal Time is now: Fri May 22 11:49:20 UTC 2015.
root@TESTHOST:~# dpkg-reconfigure
/usr/sbin/dpkg-reconfigure: please specify a package to reconfigure
root@TESTHOST:~# puppet agent --test
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for TESTHOST
Info: Applying configuration version '1432295346'
Notice: /Stage[main]/Basesystem::Timezone/File[/etc/timezone]/content:
--- /etc/timezone 2015-05-22 11:49:20.508924199 +0000
+++ /tmp/puppet-file20150522-26087-pxd7dq 2015-05-22 11:49:31.733351358 +0000
@@ -1 +1 @@
-Etc/Universal
+Etc/UTC
Info: Computing checksum on file /etc/timezone
Info: /Stage[main]/Basesystem::Timezone/File[/etc/timezone]: Filebucketed /etc/timezone to puppet with sum dbb7e95c52a24460cc98a1e41d9f94fe
Notice: /Stage[main]/Basesystem::Timezone/File[/etc/timezone]/content: content changed '{md5}dbb7e95c52a24460cc98a1e41d9f94fe' to '{md5}4f24b133ba38d8fd565168742c9aedeb'
Info: /Stage[main]/Basesystem::Timezone/File[/etc/timezone]: Scheduling refresh of Exec[/usr/sbin/dpkg-reconfigure -f noninteractive tzdata]
Notice: /Stage[main]/Basesystem::Timezone/Exec[/usr/sbin/dpkg-reconfigure -f noninteractive tzdata]: Triggered 'refresh' from 1 events
Notice: Finished catalog run in 0.68 seconds
root@TESTHOST:~# puppet agent --test
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for TESTHOST
Info: Applying configuration version '1432295346'
Notice: Finished catalog run in 0.57 seconds
root@TESTHOST:~#
Please consider adapting/integrating the logic for Debian.