Skip to content

Commit

Permalink
Merge branch 'release/4.8.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
razorsedge committed Jan 2, 2015
2 parents d7fa3f4 + b1728d3 commit bd92d34
Show file tree
Hide file tree
Showing 11 changed files with 116 additions and 82 deletions.
7 changes: 7 additions & 0 deletions .gitignore
@@ -1,2 +1,9 @@
pkg/
Gemfile.lock
vendor/
spec/fixtures/
.vagrant/
.bundle/
coverage/
*.swp
.vendor/
7 changes: 7 additions & 0 deletions .puppet-lint.rc
@@ -0,0 +1,7 @@
--fail-on-warnings
--relative
--no-80chars-check
--no-class_inherits_from_params_class-check
--no-documentation-check
--no-single_quote_string_with_variables-check
--no-selector_inside_resource-check
7 changes: 7 additions & 0 deletions .sync.yml
@@ -0,0 +1,7 @@
---
Rakefile:
extra_disabled_lint_checks:
- 'disable_selector_inside_resource'
.puppet-lint.rc:
extra_disabled_lint_checks:
- '--no-selector_inside_resource-check'
63 changes: 26 additions & 37 deletions .travis.yml
@@ -1,45 +1,34 @@
---
language: ruby
cache:
directories:
- vendor/bundle
- spec/fixtures/modules
sudo: false
branches:
only:
- master
- develop
language: ruby
bundler_args: --without development
script: "bundle exec rake spec SPEC_OPTS='--format documentation'"
rvm:
- 1.8.7
- 1.9.3
- 2.0.0
- 2.1.0
env:
matrix:
- PUPPET_GEM_VERSION="~> 2.7.0"
- PUPPET_GEM_VERSION="~> 3.2.0"
- PUPPET_GEM_VERSION="~> 3.3.0"
- PUPPET_GEM_VERSION="~> 3.4.0"
- PUPPET_GEM_VERSION="~> 3.5.0"
- PUPPET_GEM_VERSION="~> 3.6.0"
- PUPPET_GEM_VERSION="~> 3.7.0"
# https://docs.puppetlabs.com/guides/platforms.html#ruby-versions
bundler_args: --without system_tests
script: "bundle exec rake validate && bundle exec rake lint && bundle exec rake spec SPEC_OPTS='--format documentation'"
matrix:
exclude:
- rvm: 1.9.3
env: PUPPET_GEM_VERSION="~> 2.7.0"
- rvm: 2.0.0
env: PUPPET_GEM_VERSION="~> 2.7.0"
- rvm: 2.1.0
env: PUPPET_GEM_VERSION="~> 2.7.0"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 3.2.0"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 3.3.0"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 3.4.0"
- rvm: 2.1.0
env: PUPPET_GEM_VERSION="~> 3.2.0"
- rvm: 2.1.0
env: PUPPET_GEM_VERSION="~> 3.3.0"
- rvm: 2.1.0
env: PUPPET_GEM_VERSION="~> 3.4.0"
fast_finish: true
include:
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.6.0"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.7.0"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 3.0"
- rvm: 1.9.3
env: PUPPET_GEM_VERSION="~> 3.0"
- rvm: 2.0.0
env: PUPPET_GEM_VERSION="~> 3.0"
- rvm: 2.0.0
env: PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER="yes"
allow_failures:
- rvm: 2.0.0
env: PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER="yes"
notifications:
email:
- github@razorsedge.org
26 changes: 21 additions & 5 deletions Gemfile
@@ -1,9 +1,25 @@
source 'https://rubygems.org'
source ENV['GEM_SOURCE'] || "https://rubygems.org"

group :development, :test do
gem 'rake'
gem 'puppetlabs_spec_helper', :require => false
gem 'puppet-lint', '~> 0.3.2'
group :development, :unit_tests do
gem 'rake', :require => false
gem 'rspec-puppet', :require => false
gem 'puppetlabs_spec_helper', :require => false
gem 'puppet-lint', :require => false
gem 'simplecov', :require => false
gem 'puppet_facts', :require => false
gem 'json', :require => false
gem 'metadata-json-lint', :require => false
end

group :system_tests do
gem 'beaker-rspec', :require => false
gem 'serverspec', :require => false
end

if facterversion = ENV['FACTER_GEM_VERSION']
gem 'facter', facterversion, :require => false
else
gem 'facter', :require => false
end

if puppetversion = ENV['PUPPET_GEM_VERSION']
Expand Down
36 changes: 15 additions & 21 deletions Rakefile
@@ -1,25 +1,19 @@
require 'rubygems'
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-lint/tasks/puppet-lint'

desc "Run visual spec tests on an existing fixtures directory"
RSpec::Core::RakeTask.new(:spec_standalonev) do |t|
t.rspec_opts = ['--color', '--format documentation']
t.pattern = 'spec/{classes,defines,unit}/**/*_spec.rb'
end

# https://github.com/stahnma/puppet-modules/blob/master/common/Rakefile
desc "Check puppet and ERB for syntax errors."
task :validate do
Dir['manifests/**/*.pp'].each do |path|
sh "puppet parser validate --noop #{path}"
end
Dir['templates/**/*.erb'].each do |path|
sh "erb -P -x -T '-' #{path} | ruby -c"
end
end
PuppetLint.configuration.fail_on_warnings = true
PuppetLint.configuration.send('relative')
PuppetLint.configuration.send('disable_80chars')
PuppetLint.configuration.send('disable_class_inherits_from_params_class')
PuppetLint.configuration.send('disable_documentation')
PuppetLint.configuration.send('disable_single_quote_string_with_variables')
PuppetLint.configuration.send('disable_selector_inside_resource')
PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp", "vender/**/*.pp"]

# Enable puppet-lint for all manifests: rake lint
require 'puppet-lint/tasks/puppet-lint'
#PuppetLint.configuration.send("disable_80chars") # no warnings on lines over 80 chars.
PuppetLint.configuration.ignore_paths = ["spec/fixtures/**/*.pp", "pkg/**/*"]
PuppetSyntax.exclude_paths = ["spec/**/*", "pkg/**/*", "vender/**/*"]
PuppetSyntax.hieradata_paths = ["**/data/**/*.yaml", "hieradata/**/*.yaml", "hiera*.yaml"]

desc "Check puppet metadata.json with metadata-json-lint."
task :metadata do
sh "metadata-json-lint metadata.json"
end
30 changes: 15 additions & 15 deletions manifests/init.pp
Expand Up @@ -181,48 +181,48 @@
'vmware': {
if $supported {
$service_pattern = $tools_version ? {
/3\..+/ => 'vmware-guestd',
/(4.0).+/ => 'vmware-guestd',
/^3\./ => 'vmware-guestd',
/^4\.0/ => 'vmware-guestd',
default => 'vmtoolsd',
}

$rhel_upstart = $tools_version ? {
/3\..+/ => false,
/4\..+/ => false,
/(5.0).*/ => false,
/^3\./ => false,
/^4\./ => false,
/^5\.0/ => false,
default => true,
}

$package_real = $package ? {
undef => $tools_version ? {
/3\..+/ => $vmwaretools::params::package_name_4x,
/4\..+/ => $vmwaretools::params::package_name_4x,
/^3\./ => $vmwaretools::params::package_name_4x,
/^4\./ => $vmwaretools::params::package_name_4x,
default => $vmwaretools::params::package_name_5x,
},
default => $package,
}

$service_name_real = $service_name ? {
undef => $tools_version ? {
/3\..+/ => $vmwaretools::params::service_name_4x,
/4\..+/ => $vmwaretools::params::service_name_4x,
/^3\./ => $vmwaretools::params::service_name_4x,
/^4\./ => $vmwaretools::params::service_name_4x,
default => $vmwaretools::params::service_name_5x,
},
default => $service_name,
}

$service_hasstatus_real = $service_hasstatus ? {
undef => $tools_version ? {
/3\..+/ => $vmwaretools::params::service_hasstatus_4x,
/4\..+/ => $vmwaretools::params::service_hasstatus_4x,
/^3\./ => $vmwaretools::params::service_hasstatus_4x,
/^4\./ => $vmwaretools::params::service_hasstatus_4x,
default => $vmwaretools::params::service_hasstatus_5x,
},
default => $service_hasstatus,
}

$yum_basearch = $tools_version ? {
/3\..+/ => $vmwaretools::params::yum_basearch_4x,
/4\..+/ => $vmwaretools::params::yum_basearch_4x,
/^3\./ => $vmwaretools::params::yum_basearch_4x,
/^4\./ => $vmwaretools::params::yum_basearch_4x,
default => $vmwaretools::params::yum_basearch_5x,
}

Expand Down Expand Up @@ -269,8 +269,8 @@
file_line { 'disable-tools-version':
path => '/etc/vmware-tools/tools.conf',
line => $disable_tools_version ? {
false => 'disable-tools-version = "false"',
default => 'disable-tools-version = "true"',
false => 'disable-tools-version = "false"',
default => 'disable-tools-version = "true"',
},
match => '^disable-tools-version\s*=.*$',
require => Package[$package_real],
Expand Down
6 changes: 3 additions & 3 deletions metadata.json
@@ -1,17 +1,17 @@
{
"name": "razorsedge-vmwaretools",
"version": "4.8.0",
"version": "4.8.1",
"author": "razorsedge",
"summary": "VMware Tools OSP installation.",
"license": "Apache License, Version 2.0",
"license": "Apache-2.0",
"project_page": "https://github.com/razorsedge/puppet-vmwaretools",
"issues_url": "https://github.com/razorsedge/puppet-vmwaretools/issues",
"tags": [ "RHEL", "rhel", "OEL", "CentOS", "virtualization", "SuSE", "vmware", "vmware-tools", "vmware_tools", "vmtools" ],
"source": "https://github.com/razorsedge/puppet-vmwaretools.git",
"dependencies": [
{
"name": "puppetlabs/stdlib",
"version_requirement": ">=2.3.0"
"version_requirement": ">=2.3.0 <5.0.0"
},
{
"name": "wolfspyre/vmware_puppetfact",
Expand Down
9 changes: 9 additions & 0 deletions spec/classes/vmwaretools_init_spec.rb
Expand Up @@ -204,6 +204,15 @@
it { should contain_service('vmware-tools-services').with_start('/sbin/start vmware-tools-services') }
end

describe 'tools_version => 5.5p02 and operatingsystem => RedHat 6' do
let(:params) {{ :tools_version => '5.5p02' }}
it { should contain_class('vmwaretools::repo').with_tools_version('5.5p02') }
it { should contain_package('vmware-tools-esx-nox') }
it { should contain_package('vmware-tools-esx-kmods') }
it { should_not contain_service('vmware-tools-services').with_pattern('vmtoolsd') }
it { should contain_service('vmware-tools-services').with_start('/sbin/start vmware-tools-services') }
end

describe 'tools_version => 5.1 and operatingsystem => SLES' do
let(:params) {{ :tools_version => '5.1' }}
let :facts do {
Expand Down
6 changes: 6 additions & 0 deletions spec/spec.opts
@@ -0,0 +1,6 @@
--format
s
--colour
--loadby
mtime
--backtrace
1 change: 0 additions & 1 deletion spec/spec_helper.rb
@@ -1,2 +1 @@
require 'rubygems'
require 'puppetlabs_spec_helper/module_spec_helper'

0 comments on commit bd92d34

Please sign in to comment.