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

Support latest apt module #11

Merged
merged 5 commits into from
Feb 3, 2016
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
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ matrix:
services: docker
env: BEAKER_set=centos-6-x64
script: bundle exec rake beaker
- rvm: default
sudo: required
services: docker
env: BEAKER_set=ubuntu-14.04-x64
script: bundle exec rake beaker

notifications:
email: false
5 changes: 5 additions & 0 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
$metrics_plugins = {},
$check_plugins = {}
) {
file { '/etc/mackerel-agent/conf.d':
ensure => directory,
require => Package['mackerel-agent']
}

file { 'mackerel-agent.conf':
ensure => $ensure,
path => '/etc/mackerel-agent/mackerel-agent.conf',
Expand Down
23 changes: 11 additions & 12 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,29 @@
}
'Debian': {
apt::key { 'mackerel':
key => 'C2B48821',
key_source => $gpgkey_url
id => '2748FD61027D357542F8394DF92F673FC2B48821',
source => $gpgkey_url
}

apt::source { 'mackerel':
location => 'http://apt.mackerel.io/debian/',
release => 'mackerel',
repos => 'contrib',
include_src => false
location => 'http://apt.mackerel.io/debian/',
release => 'mackerel',
repos => 'contrib',
include => {
source => false
},
require => Apt::Key['mackerel']
}
}
default: {
# Do nothing
}
}
} ->

package { 'mackerel-agent':
ensure => $ensure
}

file { '/etc/mackerel-agent/conf.d':
ensure => directory,
require => Package['mackerel-agent']
}

case $use_metrics_plugins {
true: {
package { 'mackerel-agent-plugins':
Expand Down
5 changes: 3 additions & 2 deletions manifests/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
$enable = true,
) {
service { 'mackerel-agent':
ensure => $ensure,
enable => $enable
ensure => $ensure,
enable => $enable,
hasrestart => true
}
}
10 changes: 10 additions & 0 deletions spec/acceptance/nodesets/ubuntu-14.04-x64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
HOSTS:
ubuntu-14.04-x64:
platform: ubuntu-14.04-x64
image: ubuntu:trusty
hypervisor: docker
docker_preserve_image: true
CONFIG:
type: foss
log_level: debug
masterless: true
1 change: 1 addition & 0 deletions spec/classes/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
describe 'mackerel_agent::config' do
context 'with present (default)' do
it { should contain_file('mackerel-agent.conf').with_ensure('present') }
it { should contain_file('/etc/mackerel-agent/conf.d').with_ensure('directory') }
end

context 'with absent' do
Expand Down
1 change: 0 additions & 1 deletion spec/classes/install_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
describe 'mackerel_agent::install' do
context 'with present (default)' do
it { should contain_package('mackerel-agent').with_ensure('present') }
it { should contain_file('/etc/mackerel-agent/conf.d').with_ensure('directory') }
end

context 'with absent' do
Expand Down