-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from jordiprats/master
suport timedatectl
- Loading branch information
Showing
9 changed files
with
53 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
# CHANGELOG | ||
|
||
## 0.1.3 | ||
|
||
* timedatectl support (CentOS 7) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,20 @@ | ||
# == Class: timezone | ||
# | ||
# === timezone::config documentation | ||
# | ||
class timezone::config inherits timezone { | ||
|
||
file { '/etc/localtime': | ||
source => "file:///usr/share/zoneinfo/${timezone::region}/${timezone::locality}", | ||
links => 'follow', | ||
replace => true, | ||
mode => '0644', | ||
if($timezone::params::timedatectl) | ||
{ | ||
exec { 'set timezone - timedatectl': | ||
command => "timedatectl set-timezone ${timezone::region}/${timezone::locality}", | ||
unless => "timedatectl status | grep \"Time zone: ${timezone::region}/${timezone::locality}\"", | ||
path => '/usr/sbin:/usr/bin:/sbin:/bin', | ||
} | ||
} | ||
else | ||
{ | ||
file { '/etc/localtime': | ||
source => "file:///usr/share/zoneinfo/${timezone::region}/${timezone::locality}", | ||
links => 'follow', | ||
replace => true, | ||
mode => '0644', | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,12 @@ | ||
# == Class: timezone | ||
# | ||
# === timezone documentation | ||
# | ||
class timezone( | ||
$manage_package = true, | ||
$package_ensure = 'installed', | ||
$region = 'Europe', | ||
$locality = 'Andorra', | ||
) inherits timezone::params { | ||
|
||
class { '::timezone::install': } -> | ||
class { '::timezone::config': } -> | ||
Class['::timezone'] | ||
class { '::timezone::install': } | ||
-> class { '::timezone::config': } | ||
-> Class['::timezone'] | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
HOSTS: | ||
ubuntu-1604-x64: | ||
default_apply_opts: | ||
order: random | ||
strict_variables: | ||
platform: ubuntu-16.04-amd64 | ||
hypervisor : docker | ||
image: ubuntu:16.04 | ||
docker_cmd: '["/sbin/init"]' | ||
docker_preserve_image: true | ||
docker_image_commands: | ||
- 'apt-get install net-tools gcc make tar wget -y' | ||
CONFIG: | ||
type: foss | ||
log_level: debug |