From e9a13435138bbfb2db654702978a322265dc466d Mon Sep 17 00:00:00 2001 From: Jordi Prats Date: Wed, 5 Apr 2017 16:24:37 +0200 Subject: [PATCH 1/8] canvi imatge base centos5 --- spec/acceptance/nodesets/centos5-docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/acceptance/nodesets/centos5-docker.yml b/spec/acceptance/nodesets/centos5-docker.yml index b59472c..821f5a6 100644 --- a/spec/acceptance/nodesets/centos5-docker.yml +++ b/spec/acceptance/nodesets/centos5-docker.yml @@ -5,7 +5,7 @@ HOSTS: strict_variables: platform: el-5-x86_64 hypervisor : docker - image: tianon/centos:5.10 + image: jordiprats/centos5:5.11 docker_preserve_image: true docker_cmd: '["/sbin/init"]' docker_image_commands: From ef6bc388ed8905459ac64a77819965f956db66cc Mon Sep 17 00:00:00 2001 From: Jordi Prats Date: Mon, 17 Apr 2017 13:38:38 +0200 Subject: [PATCH 2/8] fora pe --- metadata.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/metadata.json b/metadata.json index 3b127a6..9e2a5e4 100644 --- a/metadata.json +++ b/metadata.json @@ -38,10 +38,6 @@ } ], "requirements": [ - { - "name": "pe", - "version_requirement": ">= 3.0.0" - }, { "name": "puppet", "version_requirement": ">= 3.0.0" From 42b99c7620805125399933d57cfee585f9c53e8c Mon Sep 17 00:00:00 2001 From: Jordi Prats Date: Tue, 18 Apr 2017 11:32:26 +0200 Subject: [PATCH 3/8] lint --- manifests/init.pp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 2e8316c..8e944f7 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -9,8 +9,8 @@ $locality = 'Andorra', ) inherits timezone::params { - class { '::timezone::install': } -> - class { '::timezone::config': } -> - Class['::timezone'] + class { '::timezone::install': } + -> class { '::timezone::config': } + -> Class['::timezone'] } From d89865b54ba37e8fe558d4c75e303f9378d3a66f Mon Sep 17 00:00:00 2001 From: Jordi Prats Date: Tue, 18 Apr 2017 11:33:12 +0200 Subject: [PATCH 4/8] detalls --- manifests/config.pp | 4 ---- manifests/init.pp | 4 ---- manifests/install.pp | 4 ---- 3 files changed, 12 deletions(-) diff --git a/manifests/config.pp b/manifests/config.pp index 5d5aa0c..f0e9346 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -1,7 +1,3 @@ -# == Class: timezone -# -# === timezone::config documentation -# class timezone::config inherits timezone { file { '/etc/localtime': diff --git a/manifests/init.pp b/manifests/init.pp index 8e944f7..120c98e 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,7 +1,3 @@ -# == Class: timezone -# -# === timezone documentation -# class timezone( $manage_package = true, $package_ensure = 'installed', diff --git a/manifests/install.pp b/manifests/install.pp index ad61dad..34f34e7 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -1,7 +1,3 @@ -# == Class: timezone -# -# === timezone::install documentation -# class timezone::install inherits timezone { if($timezone::manage_package) From 10eece5efe8bcfbf80000901c82d6de0a50dbd30 Mon Sep 17 00:00:00 2001 From: Jordi Prats Date: Tue, 18 Apr 2017 11:34:33 +0200 Subject: [PATCH 5/8] suport ubuntu 16 --- .travis.yml | 5 +++++ manifests/params.pp | 2 +- metadata.json | 2 +- spec/acceptance/nodesets/ubuntu16-docker.yml | 15 +++++++++++++++ 4 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 spec/acceptance/nodesets/ubuntu16-docker.yml diff --git a/.travis.yml b/.travis.yml index 9ddb2dc..1836168 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,3 +43,8 @@ matrix: dist: trusty bundler_args: script: sudo service docker restart ; sleep 10 && bundle exec rspec spec/acceptance/*_spec.rb + - rvm: default + env: BEAKER_set="ubuntu16-docker" + dist: trusty + bundler_args: + script: sudo service docker restart ; sleep 10 && bundle exec rspec spec/acceptance/*_spec.rb diff --git a/manifests/params.pp b/manifests/params.pp index 31a329d..232d545 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -22,7 +22,7 @@ { case $::operatingsystemrelease { - /^14.*$/: + /^1[46].*$/: { } default: { fail("Unsupported Ubuntu version! - ${::operatingsystemrelease}") } diff --git a/metadata.json b/metadata.json index 9e2a5e4..02297a6 100644 --- a/metadata.json +++ b/metadata.json @@ -34,7 +34,7 @@ }, { "operatingsystem": "Ubuntu", - "operatingsystemrelease": [ "14.04" ] + "operatingsystemrelease": [ "14.04", "16.04" ] } ], "requirements": [ diff --git a/spec/acceptance/nodesets/ubuntu16-docker.yml b/spec/acceptance/nodesets/ubuntu16-docker.yml new file mode 100644 index 0000000..67a3f61 --- /dev/null +++ b/spec/acceptance/nodesets/ubuntu16-docker.yml @@ -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 From f0b1045ca5a95c5509b4aa60f45dbcce3a6da989 Mon Sep 17 00:00:00 2001 From: Jordi Prats Date: Tue, 25 Apr 2017 17:28:06 +0200 Subject: [PATCH 6/8] timedatactrl --- CHANGELOG.md | 3 +++ manifests/config.pp | 22 ++++++++++++++++------ manifests/params.pp | 8 +++++++- metadata.json | 2 +- 4 files changed, 27 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4591f22..7431e5e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,2 +1,5 @@ # CHANGELOG +## 0.1.3 + +* timedatectl support (CentOS 7) diff --git a/manifests/config.pp b/manifests/config.pp index f0e9346..5157673 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -1,10 +1,20 @@ 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': + 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', + } } - } diff --git a/manifests/params.pp b/manifests/params.pp index 232d545..05c2b46 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -8,8 +8,13 @@ { case $::operatingsystemrelease { - /^[5-7].*$/: + /^[5-6].*$/: { + $timezonectl=false + } + /^7.*$/: + { + $timezonectl=true } default: { fail("Unsupported RHEL/CentOS version! - ${::operatingsystemrelease}") } } @@ -24,6 +29,7 @@ { /^1[46].*$/: { + $timezonectl=false } default: { fail("Unsupported Ubuntu version! - ${::operatingsystemrelease}") } } diff --git a/metadata.json b/metadata.json index 02297a6..0b893b9 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "eyp-timezone", - "version": "0.1.2", + "version": "0.1.3", "author": "eyp", "summary": "sets timezone", "license": "Apache-2.0", From af14c83c570e04a3f3fba65eea3cbf9454925244 Mon Sep 17 00:00:00 2001 From: Jordi Prats Date: Tue, 25 Apr 2017 17:29:24 +0200 Subject: [PATCH 7/8] pendent --- manifests/params.pp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index 05c2b46..5b0cad1 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -10,11 +10,11 @@ { /^[5-6].*$/: { - $timezonectl=false + $timedatectl=false } /^7.*$/: { - $timezonectl=true + $timedatectl=true } default: { fail("Unsupported RHEL/CentOS version! - ${::operatingsystemrelease}") } } @@ -29,7 +29,7 @@ { /^1[46].*$/: { - $timezonectl=false + $timedatectl=false } default: { fail("Unsupported Ubuntu version! - ${::operatingsystemrelease}") } } From c9c1a5b64a15209fdff88116f358a4ccd41539aa Mon Sep 17 00:00:00 2001 From: Jordi Prats Date: Tue, 25 Apr 2017 17:36:11 +0200 Subject: [PATCH 8/8] rename exec --- manifests/config.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/config.pp b/manifests/config.pp index 5157673..dd6c947 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -2,7 +2,7 @@ if($timezone::params::timedatectl) { - exec { 'set timezone': + 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',