diff --git a/manifests/apt/repositories.pp b/manifests/apt/repositories.pp index acf5f4be..94398d61 100644 --- a/manifests/apt/repositories.pp +++ b/manifests/apt/repositories.pp @@ -129,10 +129,7 @@ } @apt::source { 'puppet': - location => "https://apt-mirror.publiq.be/puppet-${codename}-${environment}", - release => $codename, - architecture => $arch, - repos => 'puppet' + ensure => 'absent' } @apt::source { 'hashicorp': @@ -142,6 +139,13 @@ repos => 'main' } + @apt::source { 'openvox': + location => "https://apt-mirror.publiq.be/openvox-${codename}-${environment}", + release => $codename, + architecture => $arch, + repos => 'main' + } + # Project repositories @apt::source { 'uit-mail-subscriptions': location => "https://apt.publiq.be/uit-mail-subscriptions-${environment}", diff --git a/manifests/puppet/agent.pp b/manifests/puppet/agent.pp index e9ed7df5..3d81ee3d 100644 --- a/manifests/puppet/agent.pp +++ b/manifests/puppet/agent.pp @@ -10,25 +10,31 @@ } realize Apt::Source['puppet'] + realize Apt::Source['openvox'] realize File['/etc/puppetlabs/facter/facts.d'] - package { 'puppet-agent': + package { 'openvox-agent': ensure => $version, - require => [Apt::Source['puppet'], File['/etc/puppetlabs/facter/facts.d']], + require => [Apt::Source['openvox'], File['/etc/puppetlabs/facter/facts.d']], notify => Service['puppet'] } + package { 'puppet-agent': + ensure => 'purged', + require => Package['openvox-agent'] + } + file { 'puppet agent production environment hiera.yaml': ensure => 'absent', path => '/etc/puppetlabs/code/environments/production/hiera.yaml', - require => Package['puppet-agent'] + require => Package['openvox-agent'] } file { 'puppet agent production environment datadir': ensure => 'absent', path => '/etc/puppetlabs/code/environments/production/data', force => true, - require => Package['puppet-agent'] + require => Package['openvox-agent'] } if $puppetserver { diff --git a/spec/classes/apt/repositories_spec.rb b/spec/classes/apt/repositories_spec.rb index 475b6c54..e8ae2861 100644 --- a/spec/classes/apt/repositories_spec.rb +++ b/spec/classes/apt/repositories_spec.rb @@ -44,7 +44,6 @@ include_examples 'apt repositories', 'focal-updates', { :location => 'https://apt-mirror.publiq.be/focal-updates-amd64-testing', :repos => 'main', :release => 'focal-updates' } include_examples 'apt repositories', 'focal-security', { :location => 'https://apt-mirror.publiq.be/focal-security-amd64-testing', :repos => 'main', :release => 'focal-security' } include_examples 'apt repositories', 'focal-backports', { :location => 'https://apt-mirror.publiq.be/focal-backports-amd64-testing', :repos => 'main', :release => 'focal-backports' } - include_examples 'apt repositories', 'puppet', { :location => 'https://apt-mirror.publiq.be/puppet-focal-testing', :repos => 'puppet', :release => 'focal' } include_examples 'apt repositories', 'php', { :location => 'https://apt-mirror.publiq.be/php-focal-testing', :repos => 'main', :release => 'focal' } # Do we need to check for the architecture for these repositories? @@ -60,6 +59,7 @@ include_examples 'apt repositories', 'elastic-5.x', { :location => 'https://apt-mirror.publiq.be/elastic-5.x-testing', :repos => 'main', :release => 'stable' } include_examples 'apt repositories', 'elastic-8.x', { :location => 'https://apt-mirror.publiq.be/elastic-8.x-testing', :repos => 'main', :release => 'stable' } include_examples 'apt repositories', 'hashicorp', { :location => 'https://apt-mirror.publiq.be/hashicorp-focal-testing', :repos => 'main', :release => 'focal' } + include_examples 'apt repositories', 'openvox', { :location => 'https://apt-mirror.publiq.be/openvox-focal-testing', :repos => 'main', :release => 'focal' } include_examples 'apt repositories', 'publiq-jenkins', { :location => 'https://apt.publiq.be/publiq-jenkins-testing', :repos => 'main', :release => 'focal' } include_examples 'apt repositories', 'publiq-prototypes', { :location => 'https://apt.publiq.be/publiq-prototypes-testing', :repos => 'main', :release => 'focal' } @@ -102,6 +102,7 @@ include_examples 'apt repositories', 'uit-frontend', { :location => 'https://apt.publiq.be/uit-frontend-testing', :repos => 'main', :release => 'focal' } include_examples 'apt repositories', 'uit-api', { :location => 'https://apt.publiq.be/uit-api-testing', :repos => 'main', :release => 'focal' } include_examples 'apt repositories', 'uit-cms', { :location => 'https://apt.publiq.be/uit-cms-testing', :repos => 'main', :release => 'focal' } + end context 'in the acceptance environment' do @@ -114,6 +115,10 @@ include_examples 'apt repositories', 'focal', { :location => 'https://apt-mirror.publiq.be/focal-amd64-acceptance', :repos => 'main', :release => 'focal' } include_examples 'apt repositories', 'php', { :location => 'https://apt-mirror.publiq.be/php-focal-acceptance', :repos => 'main', :release => 'focal' } + + it { is_expected.to contain_apt__source('puppet').with( + 'ensure' => 'absent' + ) } end end end diff --git a/spec/classes/puppet/agent_spec.rb b/spec/classes/puppet/agent_spec.rb index 7910b4aa..99d5dcf9 100644 --- a/spec/classes/puppet/agent_spec.rb +++ b/spec/classes/puppet/agent_spec.rb @@ -17,8 +17,9 @@ ) } it { is_expected.to contain_apt__source('puppet') } + it { is_expected.to contain_apt__source('openvox') } - it { is_expected.to contain_package('puppet-agent').with( + it { is_expected.to contain_package('openvox-agent').with( 'ensure' => 'installed' ) } @@ -72,11 +73,12 @@ 'value' => 'store', ) } - it { is_expected.to contain_apt__source('puppet').that_comes_before('Package[puppet-agent]') } - it { is_expected.to contain_package('puppet-agent').that_requires('File[/etc/puppetlabs/facter/facts.d]') } - it { is_expected.to contain_package('puppet-agent').that_notifies('Service[puppet]') } - it { is_expected.to contain_file('puppet agent production environment hiera.yaml').that_requires('Package[puppet-agent]') } - it { is_expected.to contain_file('puppet agent production environment datadir').that_requires('Package[puppet-agent]') } + it { is_expected.to contain_apt__source('puppet') } + it { is_expected.to contain_apt__source('openvox').that_comes_before('Package[openvox-agent]') } + it { is_expected.to contain_package('openvox-agent').that_requires('File[/etc/puppetlabs/facter/facts.d]') } + it { is_expected.to contain_package('openvox-agent').that_notifies('Service[puppet]') } + it { is_expected.to contain_file('puppet agent production environment hiera.yaml').that_requires('Package[openvox-agent]') } + it { is_expected.to contain_file('puppet agent production environment datadir').that_requires('Package[openvox-agent]') } it { is_expected.to contain_ini_setting('agent certificate_revocation').that_notifies('Service[puppet]') } it { is_expected.to contain_ini_setting('agent usecacheonfailure').that_notifies('Service[puppet]') } it { is_expected.to contain_ini_setting('agent reports').that_notifies('Service[puppet]') } @@ -92,7 +94,7 @@ it { is_expected.to compile.with_all_deps } - it { is_expected.to contain_package('puppet-agent').with( + it { is_expected.to contain_package('openvox-agent').with( 'ensure' => '6.23.1' ) }