Skip to content

Commit

Permalink
Merge pull request #14 from jordiprats/master
Browse files Browse the repository at this point in the history
3.8 support via versioncmp($::puppetversion, '4.0.0')
  • Loading branch information
jordiprats authored Jan 22, 2018
2 parents bba6e2b + 378d416 commit 334d62f
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## 0.1.6

* Updated validate_* functions to validate_legacy - thanks to [jtreminio](https://github.com/jtreminio) for this [PR-13](https://github.com/NTTCom-MS/eyp-redis/pull/13)

## 0.1.5

* bugfix **redis::instance** service notifications with **daemonize** set to false
Expand Down
18 changes: 14 additions & 4 deletions manifests/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,20 @@
path => '/usr/sbin:/usr/bin:/sbin:/bin',
}

validate_legacy(Boolean, 'validate_bool', $redis::manage_docker_service)
validate_legacy(Boolean, 'validate_bool', $redis::manage_service)
validate_legacy(Boolean, 'validate_bool', $redis::service_enable)
validate_legacy('Optional[String]', 'validate_re', $redis::service_ensure, [ '^running$', '^stopped$' ])
if versioncmp($::puppetversion, '4.0.0') >= 0
{
validate_legacy(Boolean, 'validate_bool', $redis::manage_docker_service)
validate_legacy(Boolean, 'validate_bool', $redis::manage_service)
validate_legacy(Boolean, 'validate_bool', $redis::service_enable)
validate_legacy('Optional[String]', 'validate_re', $redis::service_ensure, [ '^running$', '^stopped$' ])
}
else
{
validate_bool($redis::manage_docker_service)
validate_bool($redis::manage_service)
validate_bool($redis::service_enable)
validate_re($redis::service_ensure, [ '^running$', '^stopped$' ], "Not a valid daemon status: ${redis::service_ensure}")
}

$is_docker_container_var=getvar('::eyp_docker_iscontainer')
$is_docker_container=str2bool($is_docker_container_var)
Expand Down
6 changes: 3 additions & 3 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "eyp-redis",
"version": "0.1.5",
"version": "0.1.6",
"author": "eyp",
"summary": "multi instance redis",
"license": "Apache-2.0",
"source": "https://github.com/NTTCom-MS/eyp-redis",
"project_page": "https://github.com/NTTCom-MS/eyp-redis",
"issues_url": "https://github.com/NTTCom-MS/eyp-redis/issues",
"dependencies": [
{"name":"puppetlabs/stdlib", "version_requirement":">= 4.13.0 < 9.9.9"},
{"name":"puppetlabs/stdlib", "version_requirement":">= 1.0.0 < 9.9.9"},
{"name":"eyp/systemd", "version_requirement":">= 0.1.7 < 0.2.0"},
{"name":"eyp/eyplib", "version_requirement":">= 0.1.0 < 0.2.0"}
],
Expand Down Expand Up @@ -41,7 +41,7 @@
"requirements": [
{
"name": "puppet",
"version_requirement": ">= 4.0.0"
"version_requirement": ">= 3.8.0"
}
]
}
9 changes: 9 additions & 0 deletions spec/acceptance/base_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,14 @@ class { 'redis': }
it { is_expected.to be_listening }
end

it "puppet --version" do
expect(shell("puppet --version").exit_code).to be_zero
end

describe file("/etc/redis/redis-6666.conf") do
it { should be_file }
its(:content) { should match '# puppet managed file' }
end

end
end
15 changes: 15 additions & 0 deletions spec/acceptance/nodesets/ubuntu16-docker.yml
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 gcc make tar wget -y'
CONFIG:
type: foss
log_level: debug

0 comments on commit 334d62f

Please sign in to comment.