Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing param declarations (Ubuntu, Windows) #16

Merged
merged 4 commits into from
Dec 12, 2017
Merged
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
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,16 +150,22 @@ software::vcsscm::git:
Some proprietary software requires licenses.
You may need to pass these license keys and possibly urls to use those classes.

This module has been built on and tested against Puppet 3.2.4 and higher.
This module has been built on and tested against Puppet 3.2.4 and higher.
While I am sure other versions work, I have not tested them.

This module supports modern OS X, Ubuntu, and Windows systems.
This module supports modern OS X, Debian, Ubuntu, and Windows systems.
This module has been heavily tested on:
* OS X 10.10 Yosemite
* OS X 10.11 El Capitan
* OS X 10.12 Sierra
* Ubuntu Desktop 14.04
* Ubuntu Desktop 16.04
* Debian 7 (Wheezy)
* Debian 8 (Jessie)
* Debian 9 (Stretch)
* Ubuntu Desktop 12.04 LTS (Precise)
* Ubuntu Desktop 14.04 LTS (Trusty)
* Ubuntu Desktop 16.04 LTS (Xenial)
* Ubuntu Desktop 17.04 (Zesty)
* Ubuntu Desktop 17.10 (Artful)
* Windows 10

Many classes also support older versions of OS X, Ubuntu, and Windows.
Expand Down
2 changes: 1 addition & 1 deletion manifests/browsers/chrome.pp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
source => $url,
}
}
'Ubuntu': {
'Debian', 'Ubuntu': {
validate_string($url)
validate_string($channel)

Expand Down
2 changes: 1 addition & 1 deletion manifests/browsers/firefox.pp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
source => $url,
}
}
'Ubuntu': {
'Debian', 'Ubuntu': {
package { 'firefox':
ensure => $ensure,
}
Expand Down
18 changes: 18 additions & 0 deletions manifests/editors/atom.pp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,24 @@
require => Package['Atom'],
}
}
'Debian': {
validate_string($url)
$apm_require = Package['atom']

package { 'atom':
ensure => $ensure,
source => '/tmp/atom-amd64.deb',
provider => 'dpkg',
}

file { '/tmp/atom-amd64.deb':
source => 'https://atom.io/download/deb',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Puppet 4.8 this doesn't work for some reason. Despite the Puppet documentation saying it should work. I had to fall back to using archive for downloading the .deb file. Not sure why. I remember trying hard before giving up.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But then again: We're using this module, this branch in production. And it works. 😏 😲

I think the world is just flat, really.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol, it works for us in our environment.

owner => 'root',
group => 'root',
mode => '0644',
before => Package['atom'],
}
}
'Ubuntu': {
validate_string($url)
$apm_require = Package['atom']
Expand Down
33 changes: 30 additions & 3 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,10 @@
} else {
fail("The ${module_name} module only supports 'Mountain Lion', 'Mavericks', 'Yosemite', 'El Capitan', 'Sierra'.")
}
} elsif ($::operatingsystem == 'Ubuntu') and (versioncmp($::operatingsystemrelease, '12.04') >= 0) {
} elsif (
($::operatingsystem == 'Debian') and (versioncmp($::operatingsystemrelease, '7') >= 0) or
($::operatingsystem == 'Ubuntu') and (versioncmp($::operatingsystemrelease, '12.04') >= 0)
) {
#### init ####
$software_ensure = $ensure ? {
undef => latest,
Expand All @@ -129,8 +132,10 @@


#### browsers ####
$chrome_url = 'http://dl.google.com/linux/chrome/deb/'
$chrome_channel = 'stable'
$chrome_url = 'http://dl.google.com/linux/chrome/deb/'
$chrome_channel = 'stable'
$firefox_version = undef
$firefox_url = undef


#### editors ####
Expand All @@ -142,6 +147,11 @@
$skype_url = undef


#### storage ####
$filezilla_version = undef
$filezilla_url = undef


#### virtualization ####
$virtualbox_version = '5.1'
$virtualbox_build = '112440'
Expand All @@ -164,6 +174,23 @@
undef => latest,
default => $ensure,
}


#### browsers ####
$chrome_url = undef
$chrome_channel = undef
$firefox_version = undef
$firefox_url = undef


#### social ####
$skype_version = undef
$skype_url = undef


#### storage ####
$filezilla_version = undef
$filezilla_url = undef
} else {
fail("The ${module_name} module is not supported on ${::operatingsystem} with version ${::operatingsystemrelease}.")
}
Expand Down
19 changes: 13 additions & 6 deletions manifests/social/skype.pp
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,28 @@
source => $url,
}
}
'Ubuntu': {
'Debian', 'Ubuntu': {
$apt_source_ensure = $ensure ? {
'installed' => present,
'latest' => present,
default => $ensure,
}

include '::apt'
apt::source { 'skype-partner':
ensure => $apt_source_ensure,
location => 'http://archive.canonical.com/ubuntu',
repos => 'partner',
apt::source { 'skype-stable':
ensure => $apt_source_ensure,
comment => 'Skype APT sources for any Debian-based distribution, including Ubuntu',
location => 'https://repo.skype.com/deb',
release => 'stable',
repos => 'main',
architecture => 'amd64',
key => {
'id' => 'D4040146BE3972509FD57FC71F3045A5DF7587C3',
'source' => 'https://repo.skype.com/data/SKYPE-GPG-KEY',
},
} -> Class['apt::update'] ->

package { 'skype':
package { 'skypeforlinux':
ensure => $ensure,
}
}
Expand Down
2 changes: 1 addition & 1 deletion manifests/social/slack.pp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
validate_string($ensure)

case $::operatingsystem {
'Ubuntu': {
'Debian', 'Ubuntu': {
$apt_source_ensure = $ensure ? {
'installed' => present,
'latest' => present,
Expand Down
2 changes: 1 addition & 1 deletion manifests/storage/filezilla.pp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
source => $url,
}
}
'Ubuntu': {
'Debian', 'Ubuntu': {
package { 'filezilla':
ensure => $ensure,
}
Expand Down
2 changes: 1 addition & 1 deletion manifests/vcsscm/git.pp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
validate_string($ensure)

case $::operatingsystem {
'Ubuntu': {
'Debian', 'Ubuntu': {
package { 'git':
ensure => $ensure,
}
Expand Down
2 changes: 1 addition & 1 deletion manifests/virtualization/virtualbox.pp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
require => Exec['KillVirtualBoxProcesses'],
}
}
'Ubuntu': {
'Debian', 'Ubuntu': {
validate_string($version, $build, $url)
$apt_source_ensure = $ensure ? {
'installed' => present,
Expand Down
6 changes: 5 additions & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,13 @@
"operatingsystem": "Darwin",
"operatingsystemrelease": ["14", "15", "16"]
},
{
"operatingsystem": "Debian",
"operatingsystemrelease": ["7", "8", "9"]
},
{
"operatingsystem": "Ubuntu",
"operatingsystemrelease": ["12.04", "14.04", "16.04", "17.04"]
"operatingsystemrelease": ["12.04", "14.04", "16.04", "17.04", "17.10"]
},
{
"operatingsystem": "Windows",
Expand Down
11 changes: 7 additions & 4 deletions spec/classes/software_social_skype_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@
if facts[:operatingsystem] == 'Darwin'
it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_package('Skype-7.33.206').with_provider('appdmg') }
elsif facts[:operatingsystem] == 'Ubuntu'
elsif facts[:operatingsystem] =~ /^(Debian|Ubuntu)$/
it { is_expected.to compile.with_all_deps }
it {
is_expected.to contain_apt__source('skype-partner')
.with_location('http://archive.canonical.com/ubuntu')
is_expected.to contain_apt__source('skype-stable')
.with_location('https://repo.skype.com/deb')
.with_release('stable')
.with_repos('main')
.with_architecture('amd64')
}
it { is_expected.to contain_package('skype') }
it { is_expected.to contain_package('skypeforlinux') }
elsif facts[:operatingsystem] == 'windows'
it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_package('skype').with_provider('chocolatey') }
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/software_social_slack_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
end

context 'with defaults' do
if facts[:operatingsystem] == 'Ubuntu'
if facts[:operatingsystem] =~ /^(Debian|Ubuntu)$/
it { is_expected.to compile.with_all_deps }
it {
is_expected.to contain_apt__source('slack')
Expand Down