tvaughan
06/17/2022, 3:54 PMtvaughan
06/17/2022, 3:56 PMtvaughan
06/17/2022, 3:56 PMtvaughan
06/17/2022, 3:56 PMtvaughan
06/17/2022, 3:56 PMPavlos Parissis
06/17/2022, 3:56 PMclass auditbeat::install {
package { 'auditbeat':
ensure => $auditbeat::package_ensure,
}
}
and this spec:
# frozen_string_literal: true
require 'spec_helper'
describe 'auditbeat::install' do
let(:pre_condition) do
'include ::auditbeat'
end
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { os_facts }
describe "with defaults" do
it { <http://is_expected.to|is_expected.to> compile }
it { <http://is_expected.to|is_expected.to> contain_package('auditbeat') }
end
describe "should allow package_ensure to be overridden" do
let(:params) do
{
package_ensure: 'latest',
}
end
it { <http://is_expected.to|is_expected.to> compile }
it { <http://is_expected.to|is_expected.to> contain_package('auditbeat').with_ensure('latest') }
end
end
end
end
and it fails with:
auditbeat::install
on ubuntu-18.04-x86_64
with defaults
is expected to compile into a catalogue without dependency cycles
is expected to contain Package[auditbeat]
should allow package_ensure to be overridden
is expected to compile into a catalogue without dependency cycles (FAILED - 1)
is expected to contain Package[auditbeat] with ensure => "latest" (FAILED - 2)
Failures:
1) auditbeat::install on ubuntu-18.04-x86_64 should allow package_ensure to be overridden is expected to compile into a catalogue without dependency cycles
Failure/Error: it { <http://is_expected.to|is_expected.to> compile }
error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Duplicate declaration: Class[Auditbeat::Install] is already declared; cannot redeclare (line: 3) (line: 3, column: 1) on node poseidonas.eu-central-1.compute.internal
# ./spec/classes/install_spec.rb:24:in `block (5 levels) in <top (required)>'
2) auditbeat::install on ubuntu-18.04-x86_64 should allow package_ensure to be overridden is expected to contain Package[auditbeat] with ensure => "latest"
Failure/Error: it { <http://is_expected.to|is_expected.to> contain_package('auditbeat').with_ensure('latest') }
Puppet::PreformattedError:
Evaluation Error: Error while evaluating a Resource Statement, Duplicate declaration: Class[Auditbeat::Install] is already declared; cannot redeclare (line: 3) (line: 3, column: 1) on node poseidonas.eu-central-1.compute.internal
# /opt/puppetlabs/pdk/private/puppet/ruby/2.7.0/gems/puppet-7.16.0/lib/puppet/resource/catalog.rb:585:in `fail_on_duplicate_type_and_title'
and I can't understand why. Any ideas?CVQuesty
06/17/2022, 3:57 PMPavlos Parissis
06/17/2022, 3:57 PMPavlos Parissis
06/17/2022, 3:57 PMCVQuesty
06/17/2022, 3:57 PMPavlos Parissis
06/17/2022, 3:58 PMDanLeich
06/17/2022, 4:17 PMnatemccurdy
06/17/2022, 4:19 PMnatemccurdy
06/17/2022, 4:20 PMinventory
endpoint or resources
endpoint (with inventory being more common).DanLeich
06/17/2022, 4:21 PMnatemccurdy
06/17/2022, 4:21 PMinventory[certname, facts.os.family, facts.puppetversion] {
certname in nodes[certname] { latest_report_status = "failed" }
}
natemccurdy
06/17/2022, 4:21 PMinventory { facts.os.name = "CentOS" }
DanLeich
06/17/2022, 4:22 PMnatemccurdy
06/17/2022, 4:22 PMinventory { facts.os.name = "CentOS" }
jhoblitt
06/17/2022, 9:06 PMreplace => false
which is changing the target of a symlinkvchepkov
06/17/2022, 9:07 PMensure
set to?jhoblitt
06/17/2022, 9:07 PMvchepkov
06/17/2022, 9:07 PMnatemccurdy
06/17/2022, 9:10 PMreplace
is only relevant when defining the content/source of a file.jhoblitt
06/17/2022, 9:11 PMjhoblitt
06/17/2022, 9:12 PMvchepkov
06/17/2022, 9:12 PMvchepkov
06/17/2022, 9:12 PMvchepkov
06/17/2022, 9:12 PMjhoblitt
06/17/2022, 9:12 PM