diff --git a/lib/puppet/type/octavia_config.rb b/lib/puppet/type/octavia_config.rb index 2f9f41b5..9e0977b2 100644 --- a/lib/puppet/type/octavia_config.rb +++ b/lib/puppet/type/octavia_config.rb @@ -46,8 +46,8 @@ Puppet::Type.newtype(:octavia_config) do defaultto('') end - autorequire(:package) do - 'octavia' + autorequire(:anchor) do + ['octavia::install::end'] end end diff --git a/lib/puppet/type/octavia_ovn_provider_config.rb b/lib/puppet/type/octavia_ovn_provider_config.rb index 297eda3c..1c5d3ecf 100644 --- a/lib/puppet/type/octavia_ovn_provider_config.rb +++ b/lib/puppet/type/octavia_ovn_provider_config.rb @@ -46,8 +46,8 @@ Puppet::Type.newtype(:octavia_ovn_provider_config) do defaultto('') end - autorequire(:package) do - 'octavia' + autorequire(:anchor) do + ['octavia::install::end'] end end diff --git a/spec/unit/type/octavia_config_spec.rb b/spec/unit/type/octavia_config_spec.rb index 6ca7a8ea..90d29552 100644 --- a/spec/unit/type/octavia_config_spec.rb +++ b/spec/unit/type/octavia_config_spec.rb @@ -50,14 +50,14 @@ describe 'Puppet::Type.type(:octavia_config)' do }.to raise_error(Puppet::Error, /Invalid value/) end - it 'should autorequire the package that install the file' do + it 'should autorequire the anchor that install the file' do catalog = Puppet::Resource::Catalog.new - package = Puppet::Type.type(:package).new(:name => 'octavia') - catalog.add_resource package, @octavia_config + anchor = Puppet::Type.type(:anchor).new(:name => 'octavia::install::end') + catalog.add_resource anchor, @octavia_config dependency = @octavia_config.autorequire expect(dependency.size).to eq(1) expect(dependency[0].target).to eq(@octavia_config) - expect(dependency[0].source).to eq(package) + expect(dependency[0].source).to eq(anchor) end diff --git a/spec/unit/type/octavia_ovn_provider_config_spec.rb b/spec/unit/type/octavia_ovn_provider_config_spec.rb index 5af91433..744f2d1c 100644 --- a/spec/unit/type/octavia_ovn_provider_config_spec.rb +++ b/spec/unit/type/octavia_ovn_provider_config_spec.rb @@ -52,12 +52,12 @@ describe 'Puppet::Type.type(:octavia_ovn_provider_config)' do it 'should autorequire the package that install the file' do catalog = Puppet::Resource::Catalog.new - package = Puppet::Type.type(:package).new(:name => 'octavia') - catalog.add_resource package, @octavia_ovn_provider_config + anchor = Puppet::Type.type(:anchor).new(:name => 'octavia::install::end') + catalog.add_resource anchor, @octavia_ovn_provider_config dependency = @octavia_ovn_provider_config.autorequire expect(dependency.size).to eq(1) expect(dependency[0].target).to eq(@octavia_ovn_provider_config) - expect(dependency[0].source).to eq(package) + expect(dependency[0].source).to eq(anchor) end