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

Doesn't work on CentOS 7 #25

Closed
indigo423 opened this issue Feb 27, 2015 · 4 comments
Closed

Doesn't work on CentOS 7 #25

indigo423 opened this issue Feb 27, 2015 · 4 comments

Comments

@indigo423
Copy link

If i try to set the "tz" parameter to a different timezone it is not applied on CentOS 7. With Ubuntu 14.04 the cookbook works as expected.

I got it to work by applying manually the pull request: #24 and set an additional parameter use_symlink = true

@L2G
Copy link
Owner

L2G commented Mar 12, 2015

It looks like the issue with EL 7 is that the system utility for setting the timezone was replaced.

  • EL 6: set ZONE=timezone_name in /etc/sysconfig/clock, then run tzdata-update
  • EL 7: just run timedatectl set-timezone timezone_name

The reason why applying #24 worked is that it unconditionally called the linux-generic recipe, which replaces /etc/localtime on its own and is intended for systems that don't have their own utility for doing so. I don't want the cookbook to be managing /etc/localtime by default, although anyone could certainly call the linux-generic recipe directly if they prefer that approach.

As an aside, the timedatectl utility has nice, human-friendly output that explains the daylight-savings-time rules in effect for the current timezone, which I think is neato.

@indigo423
Copy link
Author

Thanks for the detailed explanation. I'll give it a try.

@L2G
Copy link
Owner

L2G commented Mar 12, 2015

Oh, and yes, I'm working on a fix for this as I type this. But if you don't see significant commits from me in the next day, I've probably given up on it and could use help. 😸

@L2G
Copy link
Owner

L2G commented Mar 12, 2015

Oh, look at this, it's the same timedatectl as the fedora recipe uses. Maybe some refactoring is in order.

L2G added a commit that referenced this issue Mar 12, 2015
* Added the command-line option `--no-ask-password` in the rhel7 recipe
* Since Fedora also uses `timedatectl`, the fedora recipe now just
  includes the rhel7 recipe
* The rhel recipe now checks the platform version, and if it is 7.0 or
  newer, it includes the rhel7 recipe and does nothing else (thus, no
  changes are needed in the default recipe)
* Updated the README to try to explain all this
* Updated the ChefSpec tests, of course!
@L2G L2G closed this as completed in 62541f8 Mar 12, 2015
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

2 participants