stromweld / chef_timezone_iii Goto Github PK
View Code? Open in Web Editor NEWDevelopment repository for the timezone_iii Chef Cookbook
License: Apache License 2.0
Development repository for the timezone_iii Chef Cookbook
License: Apache License 2.0
berks is having a problem downloading the cookbook due to lack of magic header (in tar).
this is what berks outputs when running berks install
or berks update
ArgumentError "\x80\x00\x00\x00\x02\xDB\xFD\x17" is not an octal string
this affects version 1.1.6, 1.1.5 1.1.4, 1.1.3 and i didn't check the rest (note that the error above is for 1.1.6)
seems that there is no way to bypass it using berks.
could someone please point out what is the issue.
I'm using AmazonLinux and tried to use this cookbook, and then faced an issue.
On my server ohai
output looks like below
{
"platform": "amazon",
"platform_version": "2017.03",
"platform_family": "rhel",
...
}
and timezone_iii::default
goes into branches with node['platform_family']
, not with node['platform']
:
https://github.com/Stromweld/timezone_iii/blob/master/recipes/default.rb#L25-L30
So all AmazonLinux servers go into rhel7
branch and never goes into amazon
.
For now my only workaround is installing tzdata
in other place and include_recipe 'timezone_iii::amazon'
.
Hi.
I use the cookbook to change the default timezone to 'Europe/London' but it does not change anything.
role[testing]
name "test"
description "A role just for testing."
run_list "recipe[timezone_iii]"
default_attributes(
)
override_attributes(
#timezone attributes
"timezone_iii" => {
"timezone" => "Europe/London",
"use_symlink" => "true"
}
)
but getting:
Starting Chef Client, version 12.19.36
resolving cookbooks for run list: ["timezone_iii"]
Synchronizing Cookbooks:
- timezone_iii (1.0.3)
Installing Cookbook Gems:
Compiling Cookbooks...
Converging 4 resources
Recipe: timezone_iii::default
* apt_package[tzdata] action install (up to date)
Recipe: timezone_iii::debian
* template[/etc/timezone] action create
- update content in file /etc/timezone from 2c4d4c to 188731
--- /etc/timezone 2017-06-06 12:05:50.303619956 +0000
+++ /etc/.chef-timezone20170606-7997-14fd1lu 2017-06-06 12:10:42.808840863 +0000
@@ -1,2 +1,2 @@
-Africa/Dakar
+Europe/London
* execute[dpkg-reconfigure-tzdata] action nothing (skipped due to action :nothing)
* log[if-unexpected-timezone-change] action nothing (skipped due to action :nothing)
* execute[dpkg-reconfigure-tzdata] action run
[execute]
Current default time zone: 'Africa/Dakar'
Local time is now: Tue Jun 6 12:10:42 GMT 2017.
Universal Time is now: Tue Jun 6 12:10:42 UTC 2017.
- execute /usr/sbin/dpkg-reconfigure -f noninteractive tzdata
* log[if-unexpected-timezone-change] action write
Running handlers:
Running handlers complete
Chef Client finished, 3/6 resources updated in 02 seconds
root@ip-10-0-30-18:/etc# timedatectl
Local time: Tue 2017-06-06 12:10:48 GMT
Universal time: Tue 2017-06-06 12:10:48 UTC
RTC time: Tue 2017-06-06 12:10:48
Time zone: Africa/Dakar (GMT, +0000)
Network time on: yes
NTP synchronized: yes
RTC in local TZ: no`
Its touch the timezone file but does not update it anyhow.
Amazon Linux discourages editing UTC=true
line in /etc/sysconfig/clock
as its hardware clock is set UTC.
Do not change the UTC=true entry to another value. This entry is for the hardware clock, and does not need to be adjusted when you're setting a different time zone on your instance.
For now https://github.com/Stromweld/timezone_iii/blob/master/templates/default/rhel/clock.erb only writes ZONE
but UTC
line is encouraged to be configurable.
The time zone on RHEL7/Centos7 is continually set, with every chef run:
test.box.work Recipe: timezone_iii::default
test.box.work * yum_package[tzdata] action install (up to date)
test.box.work Recipe: timezone_iii::rhel7
test.box.work * execute[timedatectl --no-ask-password set-timezone America/Vancouver] action run
test.box.work - execute timedatectl --no-ask-password set-timezone America/Vancouver
test.box.work * template[/etc/sysconfig/clock] action create (up to date)
test.box.work * execute[tzdata-update] action nothing (skipped due to action :nothing)
It maybe could have tougher guard code, unless I'm doing something obviously wrong.
For the latest amazon linux AMI the rhel7 recipe is being chosen and not the amazon recipe.
This is because in default.rb "node['platform_family']" returns "rhel". However node['platform'] is set to "amazon".
If you look at a previous version the code used the value_for_platform to further find the correct recipe:
https://github.com/L2G/timezone-ii/blob/28c9e49c58c534e798cf01a77a9373c4c54f4587/recipes/default.rb#L20
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.