Skip to content

Commit

Permalink
Merge pull request choria-io#201 from bastelfreak/puppet7
Browse files Browse the repository at this point in the history
(choria-io#200) Implement Puppet 7 support
  • Loading branch information
ripienaar authored Dec 22, 2020
2 parents 6d61de7 + 512b8b3 commit 6db63e1
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 8 deletions.
2 changes: 1 addition & 1 deletion data/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ choria::server_config:
choria::rubypath: "/opt/puppetlabs/puppet/bin/ruby"
choria::manage_package: true
choria::manage_service: true
choria::manage_package_repo: false
choria::manage_package_repo: true
choria::nightly_repo: false
choria::repo_baseurl: "https://packagecloud.io/choria"
choria::ensure: "present"
Expand Down
2 changes: 2 additions & 0 deletions data/os/AIX.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
choria::manage_package_repo: false
2 changes: 2 additions & 0 deletions data/os/Archlinux.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
choria::manage_package_repo: false
1 change: 1 addition & 0 deletions data/os/FreeBSD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ choria::server_config_file: "/usr/local/etc/choria/server.conf"
choria::server_provisioning_token_file: "/usr/local/etc/choria/provisioning.jwt"
choria::config_group: "wheel"
choria::mcollective_config_dir: "/usr/local/etc/mcollective"
choria::manage_package_repo: false
1 change: 1 addition & 0 deletions data/os/OpenBSD.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
choria::mcollective_config_dir: "/etc/mcollective"
choria::manage_package_repo: false
2 changes: 2 additions & 0 deletions data/os/Solaris.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
choria::manage_package_repo: false
2 changes: 2 additions & 0 deletions data/os/Suse.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
choria::manage_package_repo: false
1 change: 1 addition & 0 deletions data/os/windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ choria::manage_service: false
choria::mcollective_config_dir: "C:/ProgramData/choria/etc"
choria::config_user: ~
choria::config_group: ~
choria::manage_package_repo: false
1 change: 0 additions & 1 deletion data/puppet_aio/6.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions hiera.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,5 @@ hierarchy:
- name: "OS family"
path: "os/%{facts.os.family}.yaml"

- name: "AIO version specific common"
path: "puppet_aio/%{facts.mcollective.aio_major_version}.yaml"

- name: "common"
path: "common.yaml"
15 changes: 12 additions & 3 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
it { is_expected.to contain_class('choria') }
it { is_expected.to contain_class('choria::config') }
it { is_expected.to contain_class('choria::install') }
it { is_expected.not_to contain_class('choria::repo') }
it { is_expected.to contain_class('choria::service') }
it { is_expected.to contain_class('choria::scout_checks') }
it { is_expected.to contain_class('choria::scout_metrics') }
Expand Down Expand Up @@ -52,11 +51,21 @@
it { is_expected.to contain_file('/usr/local/etc/choria/server.conf') }
it { is_expected.to contain_file('/usr/local/etc/choria/machine').with_ensure('directory') }
end

if ['FreeBSD', 'AIX', 'Solaris', 'windows', 'SLES'].include? facts[:os]['name']
it { is_expected.not_to contain_class('choria::repo') }
else
it { is_expected.to contain_class('choria::repo') }
end
end

context 'repo related tests' do
it 'should not manage the repo by default' do
is_expected.to_not contain_class('choria::repo')
context 'should not manage the repo if its disabled' do
let :params do
{ manage_package_repo: false }
end

it { is_expected.to_not contain_class('choria::repo') }
end

context 'with manage_package_repo set to true' do
Expand Down

0 comments on commit 6db63e1

Please sign in to comment.