Skip to content

Commit

Permalink
(PUP-4478) Add Deb package support
Browse files Browse the repository at this point in the history
Adds support for Debian 6 and 7, and Ubuntu 12.04, 14.04, and 14.10.
  • Loading branch information
Michael Smith committed Jun 5, 2015
1 parent 51087f0 commit 503bb2f
Show file tree
Hide file tree
Showing 10 changed files with 222 additions and 155 deletions.
1 change: 1 addition & 0 deletions .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ fixtures:
repositories:
stdlib: "https://github.com/puppetlabs/puppetlabs-stdlib.git"
inifile: "https://github.com/puppetlabs/puppetlabs-inifile.git"
apt: "https://github.com/puppetlabs/puppetlabs-apt.git"
symlinks:
puppet_agent: "#{source_dir}"
12 changes: 12 additions & 0 deletions manifests/osfamily/debian.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class puppet_agent::osfamily::debian {
include apt

apt::source { 'pc1_repo':
location => 'http://apt.puppetlabs.com',
repos => 'PC1',
key => {
'id' => '47B320EB4C7C375AA9DAE1A01054B7A24BD6EC30',
'server' => 'pgp.mit.edu',
}
}
}
4 changes: 2 additions & 2 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#
class puppet_agent::params {
case $::osfamily {
# TODO: Add Debian, Windows
'RedHat', 'Amazon': {
# TODO: Windows
'RedHat', 'Amazon', 'Debian': {
$package_name = 'puppet-agent'
$service_names = ['puppet', 'mcollective']

Expand Down
18 changes: 17 additions & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,26 @@
"6",
"7"
]
},
{
"operatingsystem": "Debian",
"operatingsystemrelease": [
"6",
"7"
]
},
{
"operatingsystem": "Ubuntu",
"operatingsystemrelease": [
"12.04",
"14.04",
"14.10"
]
}
],
"dependencies": [
{"name":"puppetlabs-stdlib","version_requirement":">= 4.6.0"},
{"name":"puppetlabs-inifile","version_requirement":">= 1.2.0"}
{"name":"puppetlabs-inifile","version_requirement":">= 1.2.0"},
{"name":"puppetlabs-apt","version_requirement":">= 2.0.1"}
]
}
2 changes: 0 additions & 2 deletions spec/acceptance/class_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,10 @@ class { 'puppet_agent': service_names => [] }
end

describe service('puppet') do
it { is_expected.to_not be_enabled }
it { is_expected.to_not be_running }
end

describe service('mcollective') do
it { is_expected.to_not be_enabled }
it { is_expected.to_not be_running }
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/acceptance/nodesets/debian-6-x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ HOSTS:
- agent
- default
platform: debian-6-amd64
box: puppetlabs/debian-6.0.9-64-nocm
box_url: https://vagrantcloud.com/puppetlabs/boxes/debian-6.0.9-64-nocm
box: puppetlabs/debian-6.0.10-64-nocm
box_url: https://vagrantcloud.com/puppetlabs/boxes/debian-6.0.10-64-nocm
hypervisor: vagrant

CONFIG:
Expand Down
4 changes: 2 additions & 2 deletions spec/acceptance/nodesets/debian-7-x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ HOSTS:
- agent
- default
platform: debian-7-amd64
box: puppetlabs/debian-7.6-64-nocm
box_url: https://vagrantcloud.com/puppetlabs/boxes/debian-7.6-64-nocm
box: puppetlabs/debian-7.8-64-nocm
box_url: https://vagrantcloud.com/puppetlabs/boxes/debian-7.8-64-nocm
hypervisor: vagrant

CONFIG:
Expand Down
22 changes: 22 additions & 0 deletions spec/classes/puppet_agent_osfamily_debian_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
require 'spec_helper'

describe 'puppet_agent::osfamily::debian' do
let(:facts) {{
:lsbdistid => 'Debian',
:osfamily => 'Debian',
:lsbdistcodename => 'wheezy',
:operatingsystem => 'Debian',
:architecture => 'foo',
}}

it { is_expected.to contain_class('apt') }

it { is_expected.to contain_apt__source('pc1_repo').with({
'location' => 'http://apt.puppetlabs.com',
'repos' => 'PC1',
'key' => {
'id' => '47B320EB4C7C375AA9DAE1A01054B7A24BD6EC30',
'server' => 'pgp.mit.edu',
},
}) }
end
Loading

0 comments on commit 503bb2f

Please sign in to comment.