diff --git a/data/common.yaml b/data/common.yaml index a39198a..dfb872a 100644 --- a/data/common.yaml +++ b/data/common.yaml @@ -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" diff --git a/data/os/AIX.yaml b/data/os/AIX.yaml new file mode 100644 index 0000000..161dc15 --- /dev/null +++ b/data/os/AIX.yaml @@ -0,0 +1,2 @@ +--- +choria::manage_package_repo: false diff --git a/data/os/Archlinux.yaml b/data/os/Archlinux.yaml new file mode 100644 index 0000000..161dc15 --- /dev/null +++ b/data/os/Archlinux.yaml @@ -0,0 +1,2 @@ +--- +choria::manage_package_repo: false diff --git a/data/os/FreeBSD.yaml b/data/os/FreeBSD.yaml index ec060b1..00bff51 100644 --- a/data/os/FreeBSD.yaml +++ b/data/os/FreeBSD.yaml @@ -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 diff --git a/data/os/OpenBSD.yaml b/data/os/OpenBSD.yaml index df7e5dd..fb58d79 100644 --- a/data/os/OpenBSD.yaml +++ b/data/os/OpenBSD.yaml @@ -1,2 +1,3 @@ --- choria::mcollective_config_dir: "/etc/mcollective" +choria::manage_package_repo: false diff --git a/data/os/Solaris.yaml b/data/os/Solaris.yaml new file mode 100644 index 0000000..161dc15 --- /dev/null +++ b/data/os/Solaris.yaml @@ -0,0 +1,2 @@ +--- +choria::manage_package_repo: false diff --git a/data/os/Suse.yaml b/data/os/Suse.yaml new file mode 100644 index 0000000..161dc15 --- /dev/null +++ b/data/os/Suse.yaml @@ -0,0 +1,2 @@ +--- +choria::manage_package_repo: false diff --git a/data/os/windows.yaml b/data/os/windows.yaml index 6dd5d75..d51ff8c 100644 --- a/data/os/windows.yaml +++ b/data/os/windows.yaml @@ -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 diff --git a/data/puppet_aio/6.yaml b/data/puppet_aio/6.yaml deleted file mode 100644 index a43d28e..0000000 --- a/data/puppet_aio/6.yaml +++ /dev/null @@ -1 +0,0 @@ -choria::manage_package_repo: true diff --git a/hiera.yaml b/hiera.yaml index 1165dc0..820e03c 100644 --- a/hiera.yaml +++ b/hiera.yaml @@ -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" diff --git a/spec/classes/init_spec.rb b/spec/classes/init_spec.rb index d60ce96..bec34c8 100644 --- a/spec/classes/init_spec.rb +++ b/spec/classes/init_spec.rb @@ -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') } @@ -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