Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ script: "bundle exec rake validate && bundle exec rake lint && bundle exec rake
matrix:
fast_finish: true
include:
- 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"
- rvm: 2.1.9
env: PUPPET_GEM_VERSION="~> 4.0" STRICT_VARIABLES="no"
- rvm: 2.1.9
env: PUPPET_GEM_VERSION="~> 4.0"
- rvm: 2.4.1
Expand Down
26 changes: 19 additions & 7 deletions manifests/repo.pp
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,25 @@
}

include '::apt'
apt::source { 'vmware-tools':
ensure => $ensure,
comment => "VMware Tools ${tools_version} - ${vmwaretools::params::baseurl_string} ${::lsbdistcodename}",
location => $baseurl_url,
key_source => $gpgkey,
#key => '0xC0B5E0AB66FD4949',
key => '36E47E1CC4DCC5E8152D115CC0B5E0AB66FD4949',
if versioncmp($::puppetversion, '4') < 0 {
apt::source { 'vmware-tools':
ensure => $ensure,
comment => "VMware Tools ${tools_version} - ${vmwaretools::params::baseurl_string} ${::lsbdistcodename}",
location => $baseurl_url,
key_source => $gpgkey,
#key => '0xC0B5E0AB66FD4949',
key => '36E47E1CC4DCC5E8152D115CC0B5E0AB66FD4949',
}
}else{
apt::source { 'vmware-tools':
ensure => $ensure,
comment => "VMware Tools ${tools_version} - ${vmwaretools::params::baseurl_string} ${::lsbdistcodename}",
location => $baseurl_url,
key => {
source => $gpgkey,
id => '36E47E1CC4DCC5E8152D115CC0B5E0AB66FD4949',
}
}
}
}
default: { }
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
{
"name": "puppetlabs/apt",
"version_requirement": ">=2.0.0 <3.0.0"
"version_requirement": ">=2.0.0 <5.0.0"
},
{
"name": "wolfspyre/vmware_puppetfact",
Expand Down
9 changes: 8 additions & 1 deletion spec/classes/vmwaretools_init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,13 @@

describe 'for osfamily Debian and operatingsystem Ubuntu' do
let :facts do {
:os => {
:family => 'Debian',
:name => 'Ubuntu',
:release => {
:full => '12.04'
}
},
:virtual => 'vmware',
:osfamily => 'Debian',
:operatingsystem => 'Ubuntu',
Expand All @@ -200,7 +207,7 @@
:architecture => 'amd64',
:lsbdistcodename => 'precise',
:lsbdistid => 'Ubuntu',
:puppetversion => '3.5.1'
:puppetversion => Puppet.version
}
end
it { should contain_class('vmwaretools::repo').with(
Expand Down
85 changes: 75 additions & 10 deletions spec/classes/vmwaretools_repo_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
describe "for osfamily #{osf} operatingsystem #{os}" do
let(:params) {{}}
let :facts do {
:os => {
:family => osf,
:name => os,
},
:osfamily => osf,
:operatingsystem => os,
:operatingsystemrelease => '1.0',
Expand All @@ -54,6 +58,10 @@
redhatish.each do |os|
describe "for operating system #{os}" do
let :facts do {
:os => {
:family => 'RedHat',
:name => os,
},
:virtual => 'vmware',
:osfamily => 'RedHat',
:operatingsystemrelease => '6.1',
Expand Down Expand Up @@ -82,6 +90,10 @@
suseish.each do |os|
describe "for operating system #{os}" do
let :facts do {
:os => {
:family => 'SuSE',
:name => os,
},
:virtual => 'vmware',
:osfamily => 'SuSE',
:operatingsystemrelease => '10',
Expand All @@ -106,10 +118,20 @@
end
end

describe "for operating system Ubuntu" do
# Get puppetversion for Ubuntu tests
puppetversion = Puppet.version.to_i

describe "for operating system Ubuntu Puppet 3" do
let(:pre_condition) { "class { 'apt': }" }
let :facts do {
:virtual => 'vmware',
:os => {
:family => 'Debian',
:name => 'Ubuntu',
:release => {
:full => '12.04'
}
},
:osfamily => 'Debian',
:operatingsystemrelease => '12.04',
:lsbmajdistrelease => '12',
Expand All @@ -118,22 +140,65 @@
:operatingsystem => 'Ubuntu',
:lsbdistcodename => 'precise',
:lsbdistid => 'Ubuntu',
:puppetversion => '3.5.1'
:puppetversion => Puppet.version
}
end
it { should contain_apt__source('vmware-tools').with(
:comment => 'VMware Tools latest - ubuntu precise',
:ensure => 'present',
:location => 'http://packages.vmware.com/tools/esx/latest/ubuntu',
:key_source => 'http://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-RSA-KEY.pub',
#:key => '0xC0B5E0AB66FD4949',
:key => '36E47E1CC4DCC5E8152D115CC0B5E0AB66FD4949'
)}
if puppetversion < 4
it { should contain_apt__source('vmware-tools').with(
:comment => 'VMware Tools latest - ubuntu precise',
:ensure => 'present',
:location => 'http://packages.vmware.com/tools/esx/latest/ubuntu',
:key_source => 'http://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-RSA-KEY.pub',
#:key => '0xC0B5E0AB66FD4949',
:key => '36E47E1CC4DCC5E8152D115CC0B5E0AB66FD4949'
)}
end
end
describe "for operating system Ubuntu Puppet >= 4" do
let(:pre_condition) { "class { 'apt': }" }
let :facts do {
:virtual => 'vmware',
:os => {
:family => 'Debian',
:name => 'Ubuntu',
:release => {
:full => '12.04'
}
},
:osfamily => 'Debian',
:operatingsystemrelease => '12.04',
:lsbmajdistrelease => '12',
:operatingsystemmajrelease => '12',
:architecture => 'amd64',
:operatingsystem => 'Ubuntu',
:lsbdistcodename => 'precise',
:lsbdistid => 'Ubuntu',
:puppetversion => Puppet.version
}
end
if puppetversion > 3
it { should contain_apt__source('vmware-tools').with(
:comment => 'VMware Tools latest - ubuntu precise',
:ensure => 'present',
:location => 'http://packages.vmware.com/tools/esx/latest/ubuntu',
:key => {
'source' => 'http://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-RSA-KEY.pub',
'id' => '36E47E1CC4DCC5E8152D115CC0B5E0AB66FD4949'
}
)}
end
end
end

context 'on a supported operatingsystem, vmware platform, custom parameters' do
let :facts do {
:os => {
:family => 'RedHat',
:name => 'RedHat',
:release => {
:full => '6.1'
}
},
:virtual => 'vmware',
:osfamily => 'RedHat',
:operatingsystem => 'RedHat',
Expand Down