Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timezone processing is triggered on every update on Debian #27

Closed
andvgal opened this issue May 22, 2015 · 5 comments
Closed

Timezone processing is triggered on every update on Debian #27

andvgal opened this issue May 22, 2015 · 5 comments

Comments

@andvgal
Copy link

andvgal commented May 22, 2015

Please consider configuration and it results:

    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.

The temporary solution below works as expected:

    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
    }
}

Result:

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.

@andvgal andvgal changed the title Timezone processing is triggeer on every update on Debian Timezone processing is triggered on every update on Debian May 22, 2015
@saz
Copy link
Owner

saz commented May 24, 2015

This issue should be resolved in the newest release and I'm not able to reproduce it.
Please feel free to reopen this issue, if it's not resolved for you.

@saz saz closed this as completed May 24, 2015
@cs278
Copy link

cs278 commented Jun 9, 2015

This is still an issue with 3.3.0. The problem is the way this module configures the timezone settings is not what Debian expects.

If you run through manual configuration of timezone using dpkg-reconfigure tzdata you find that /etc/timezone contains Etc/UTC and /etc/localtime is a copy of /usr/share/zoneinfo/Etc/UTC.

When this module runs dpkg-reconfigure -f noninteractive tzdata Debian changes the files to match what I described above, so the next Puppet run sees a difference in /etc/timezone and changes everything back.

@saz To resolve this I believe under Debian UTC needs to be normalised to Etc/UTC. It might also be worth replicating the correct behaviour with regards to the localtime file.

To reproduce use the following echo UTC > /etc/timezone && dpkg-reconfigure -f noninteractive tzdata and then run Puppet with timezone => UTC.

@infragilis
Copy link

first off .. thanks for the mods .. im using a few :P whats the word on this one , same issue here

Linux puppet 3.13.0-57-generic #95-Ubuntu SMP Fri Jun 19 09:28:15 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

saz-timezone (v3.3.0)

@andvgal
Copy link
Author

andvgal commented Sep 4, 2015

Debian way would be to use debconf-set-selections

openstack-gerrit pushed a commit to openstack-infra/system-config that referenced this issue Nov 23, 2015
There is a bug in the timezone module[1] that causes the file
/etc/timezone to be updated on every puppet run, which also triggers
updating /etc/localtime[2]. Setting the timezone to 'Etc/UTC' works
around the bug. Both Ubuntu and CentOS 6/7 will accept this value and
accordingly set the timezone to UTC.

[1] saz/puppet-timezone#27 (comment)
[2] http://puppetboard.openstack.org/report/ask.openstack.org/b2283efae27b623cb7a1e7b5e99c62fe3a2a98ef

Change-Id: I682154c077856984c61daee3984abfe2ca3294f8
openstack-gerrit pushed a commit to openstack/openstack that referenced this issue Nov 23, 2015
Project: openstack-infra/system-config  303a26d299ba6a3c42922a571e3dc4313d678694

Change timezone to 'Etc/UTC'

There is a bug in the timezone module[1] that causes the file
/etc/timezone to be updated on every puppet run, which also triggers
updating /etc/localtime[2]. Setting the timezone to 'Etc/UTC' works
around the bug. Both Ubuntu and CentOS 6/7 will accept this value and
accordingly set the timezone to UTC.

[1] saz/puppet-timezone#27 (comment)
[2] http://puppetboard.openstack.org/report/ask.openstack.org/b2283efae27b623cb7a1e7b5e99c62fe3a2a98ef

Change-Id: I682154c077856984c61daee3984abfe2ca3294f8
vladgh added a commit to vghn/puppet that referenced this issue Dec 2, 2015
@hboetes
Copy link

hboetes commented Jun 18, 2018

Notice: /Stage[main]/Timezone/Debconf[tzdata/Areas]/value: value changed 'Europe' to 'CEST'
Notice: /Stage[main]/Timezone/File[/etc/timezone]/content:
--- /etc/timezone 2018-06-18 15:05:52.492745126 +0200
+++ /root/.tmp/puppet-file20180618-8034-cq5soa 2018-06-18 15:06:06.032801809 +0200
@@ -1 +1 @@
-Europe/Vienna
+CEST

Info: Computing checksum on file /etc/timezone
Info: /Stage[main]/Timezone/File[/etc/timezone]: Filebucketed /etc/timezone to puppet with sum 9b047fbf60efc3082d2fc1face949a53
Notice: /Stage[main]/Timezone/File[/etc/timezone]/content:
It's still happening.

Notice: /Stage[main]/Timezone/File[/etc/timezone]/content: content changed '{md5}9b047fbf60efc3082d2fc1face949a53' to '{md5}75ebc28513ccd21406969301e4b59c85'
Info: /Stage[main]/Timezone/File[/etc/timezone]: Scheduling refresh of Exec[update_timezone]
Notice: /Stage[main]/Timezone/Exec[update_timezone]: Triggered 'refresh' from 1 event
Error: /Stage[main]/Timezone/File[/etc/localtime]: Could not evaluate: Could not retrieve information from environment development source(s) file:///usr/share/zoneinfo/CEST
Info: Class[Timezone]: Unscheduling all events on Class[Timezone]
Notice: Applied catalog in 3.75 seconds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants