From 471eb1bbf23cfc74edf68bd62612c7270cf4b9bc Mon Sep 17 00:00:00 2001 From: Max Wilhelm Date: Sat, 23 Jan 2016 00:32:29 +0100 Subject: [PATCH] added debian support --- README.md | 4 ++++ manifests/params.pp | 9 +------- manifests/repo/apt.pp | 22 ++++++++++--------- metadata.json | 4 ++++ spec/acceptance/fluentd_spec.rb | 2 +- spec/acceptance/nodesets/debian-60-x64.yml | 10 +++++++++ spec/acceptance/nodesets/debian-78-x64.yml | 10 +++++++++ spec/acceptance/nodesets/debian-82-x64.yml | 10 +++++++++ .../nodesets/ubuntu-server-1204-x64.yml | 2 +- .../nodesets/ubuntu-server-1404-x64.yml | 10 +++++++++ spec/classes/fluentd_repo_apt_spec.rb | 12 +++++----- 11 files changed, 70 insertions(+), 25 deletions(-) create mode 100644 spec/acceptance/nodesets/debian-60-x64.yml create mode 100644 spec/acceptance/nodesets/debian-78-x64.yml create mode 100644 spec/acceptance/nodesets/debian-82-x64.yml create mode 100644 spec/acceptance/nodesets/ubuntu-server-1404-x64.yml diff --git a/README.md b/README.md index 1a880dd..1e4a502 100644 --- a/README.md +++ b/README.md @@ -265,6 +265,10 @@ bundle install --path vendor/bundle bundle exec rake spec bundle exec rake lint bundle exec rake beaker BEAKER_set=ubuntu-server-1204-x64 +bundle exec rake beaker BEAKER_set=ubuntu-server-1404-x64 +bundle exec rake beaker BEAKER_set=debian-60-x64 +bundle exec rake beaker BEAKER_set=debian-78-x64 +bundle exec rake beaker BEAKER_set=debian-82-x64 ``` ## License diff --git a/manifests/params.pp b/manifests/params.pp index 59b1646..08a9455 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -20,14 +20,7 @@ class fluentd::params { case $::osfamily { 'Debian': { - case $::operatingsystem { - 'Ubuntu': { - $repo_manage = true - } - default: { - fail("Unsupported osfamily: ${::operatingsystem}") - } - } + $repo_manage = true } default: { fail("Unsupported osfamily: ${::osfamily}") diff --git a/manifests/repo/apt.pp b/manifests/repo/apt.pp index 1832ea0..23507de 100644 --- a/manifests/repo/apt.pp +++ b/manifests/repo/apt.pp @@ -1,11 +1,12 @@ # Configure apt::source # class fluentd::repo::apt ( - $ensure = 'present', - $location = downcase("http://packages.treasuredata.com/2/${::operatingsystem}/${::lsbdistcodename}"), - $release = $::lsbdistcodename, - $repos = 'contrib', - $key = { + $ensure = 'present', + $location = downcase("http://packages.treasuredata.com/2/${::operatingsystem}/${::lsbdistcodename}"), + $release = $::lsbdistcodename, + $repos = 'contrib', + $architecture = $::architecture, + $key = { 'id' => 'C901622B5EC4AF820C38AB861093DB45A12E206F', 'source' => 'http://packages.treasuredata.com/GPG-KEY-td-agent' }, @@ -14,10 +15,11 @@ class fluentd::repo::apt ( include '::apt' apt::source { 'treasure-data': - ensure => $ensure, - location => $location, - release => $release, - repos => $repos, - key => $key, + ensure => $ensure, + location => $location, + release => $release, + architecture => $architecture, + repos => $repos, + key => $key, } } diff --git a/metadata.json b/metadata.json index ff61af6..f25beae 100644 --- a/metadata.json +++ b/metadata.json @@ -12,6 +12,10 @@ { "operatingsystem": "Ubuntu", "operatingsystemrelease": [ "14.04", "12.04" ] + }, + { + "operatingsystem": "Debian", + "operatingsystemrelease": [ "6", "7", "8"] } ], "dependencies": [ diff --git a/spec/acceptance/fluentd_spec.rb b/spec/acceptance/fluentd_spec.rb index 70a7eae..31b45d7 100644 --- a/spec/acceptance/fluentd_spec.rb +++ b/spec/acceptance/fluentd_spec.rb @@ -14,7 +14,7 @@ RSpec.describe 'fluentd' do end describe service('td-agent') do - it { is_expected.to be_enabled.with_level(3) } + it { is_expected.to be_enabled } it { is_expected.to be_running } end end diff --git a/spec/acceptance/nodesets/debian-60-x64.yml b/spec/acceptance/nodesets/debian-60-x64.yml new file mode 100644 index 0000000..f3d02b0 --- /dev/null +++ b/spec/acceptance/nodesets/debian-60-x64.yml @@ -0,0 +1,10 @@ +HOSTS: + debian-60-x64: + roles: + - master + platform: debian-6-amd64 + box: puppetlabs/debian-6.0.10-64-nocm + hypervisor: vagrant +CONFIG: + log_level: info + type: foss diff --git a/spec/acceptance/nodesets/debian-78-x64.yml b/spec/acceptance/nodesets/debian-78-x64.yml new file mode 100644 index 0000000..b471382 --- /dev/null +++ b/spec/acceptance/nodesets/debian-78-x64.yml @@ -0,0 +1,10 @@ +HOSTS: + debian-78-x64: + roles: + - master + platform: debian-7-amd64 + box: puppetlabs/debian-7.8-64-nocm + hypervisor: vagrant +CONFIG: + log_level: info + type: foss diff --git a/spec/acceptance/nodesets/debian-82-x64.yml b/spec/acceptance/nodesets/debian-82-x64.yml new file mode 100644 index 0000000..ac9e86c --- /dev/null +++ b/spec/acceptance/nodesets/debian-82-x64.yml @@ -0,0 +1,10 @@ +HOSTS: + debian-82-x64: + roles: + - master + platform: debian-8-amd64 + box: puppetlabs/debian-8.2-64-nocm + hypervisor: vagrant +CONFIG: + log_level: info + type: foss diff --git a/spec/acceptance/nodesets/ubuntu-server-1204-x64.yml b/spec/acceptance/nodesets/ubuntu-server-1204-x64.yml index 3cc4198..34fca14 100644 --- a/spec/acceptance/nodesets/ubuntu-server-1204-x64.yml +++ b/spec/acceptance/nodesets/ubuntu-server-1204-x64.yml @@ -6,5 +6,5 @@ HOSTS: box: puppetlabs/ubuntu-12.04-64-nocm hypervisor: vagrant CONFIG: - log_level: verbose + log_level: info type: foss diff --git a/spec/acceptance/nodesets/ubuntu-server-1404-x64.yml b/spec/acceptance/nodesets/ubuntu-server-1404-x64.yml new file mode 100644 index 0000000..80373b6 --- /dev/null +++ b/spec/acceptance/nodesets/ubuntu-server-1404-x64.yml @@ -0,0 +1,10 @@ +HOSTS: + ubuntu-server-1404-x64: + roles: + - master + platform: ubuntu-14.04-amd64 + box: puppetlabs/ubuntu-14.04-64-nocm + hypervisor: vagrant +CONFIG: + log_level: info + type: foss diff --git a/spec/classes/fluentd_repo_apt_spec.rb b/spec/classes/fluentd_repo_apt_spec.rb index 6af87a2..3b7782f 100644 --- a/spec/classes/fluentd_repo_apt_spec.rb +++ b/spec/classes/fluentd_repo_apt_spec.rb @@ -7,6 +7,7 @@ describe 'fluentd::repo::apt', :type => :class do :lsbdistid => 'Ubuntu', :operatingsystem => 'Ubuntu', :lsbdistcodename => 'precise', + :architecture => 'amd64', } } @@ -14,11 +15,12 @@ describe 'fluentd::repo::apt', :type => :class do it { should contain_class('apt') should contain_apt__source('treasure-data').with({ - 'ensure' => 'present', - 'location' => 'http://packages.treasuredata.com/2/ubuntu/precise', - 'release' => 'precise', - 'repos' => 'contrib', - 'key' => { + 'ensure' => 'present', + 'location' => 'http://packages.treasuredata.com/2/ubuntu/precise', + 'release' => 'precise', + 'repos' => 'contrib', + 'architecture' => 'amd64', + 'key' => { 'id' => 'C901622B5EC4AF820C38AB861093DB45A12E206F', 'source' => 'http://packages.treasuredata.com/GPG-KEY-td-agent' }