diff --git a/README.rst b/README.rst index ced4b00..1222ee4 100644 --- a/README.rst +++ b/README.rst @@ -21,7 +21,7 @@ Requirements ============ - Chef 15 or higher -- Chef Workstation 20.8.111 for testing (also includes Berkshelf for +- Chef Workstation 21.2.303 for testing (also includes Berkshelf for cookbook dependency resolution) Cookbooks diff --git a/metadata.rb b/metadata.rb index f4c915b..5d38192 100644 --- a/metadata.rb +++ b/metadata.rb @@ -14,7 +14,7 @@ depends 'openstackclient' depends 'openstack-common', '>= 20.0.0' depends 'openstack-dns', '>= 20.0.0' depends 'openstack-image', '>= 20.0.0' -depends 'resolver' +depends 'resolver', '>= 3.0.0' issues_url 'https://launchpad.net/openstack-chef' source_url 'https://opendev.org/openstack/cookbook-openstack-integration-test' diff --git a/recipes/dns.rb b/recipes/dns.rb index b5d9d05..7555d28 100644 --- a/recipes/dns.rb +++ b/recipes/dns.rb @@ -32,10 +32,10 @@ end # Match what opendev/base-jobs uses for unbound: # https://opendev.org/opendev/base-jobs/src/branch/master/roles/configure-unbound/defaults/main.yaml#L1-L7 -node.default['resolver']['search'] = [] -node.default['resolver']['nameservers'] = %w(1.0.0.1 8.8.8.8) -include_recipe 'resolver' +resolver_config '/etc/resolv.conf' do + nameservers %w(1.0.0.1 8.8.8.8) +end # Disable and stop unbound so we can properly test Designate service 'unbound' do diff --git a/spec/dns-rhel_spec.rb b/spec/dns-rhel_spec.rb index fd29525..df01972 100644 --- a/spec/dns-rhel_spec.rb +++ b/spec/dns-rhel_spec.rb @@ -10,13 +10,10 @@ describe 'openstack-integration-test::dns' do include_context 'tempest-stubs' - [ - /^nameserver 1.0.0.1$/, - /^nameserver 8.8.8.8$/, - ].each do |line| - it do - expect(chef_run).to render_file('/etc/resolv.conf').with_content(line) - end + it do + expect(chef_run).to set_resolver_config('/etc/resolv.conf').with( + nameservers: %w(1.0.0.1 8.8.8.8) + ) end it do diff --git a/spec/dns_spec.rb b/spec/dns_spec.rb index f51289b..7f9877b 100644 --- a/spec/dns_spec.rb +++ b/spec/dns_spec.rb @@ -15,13 +15,10 @@ describe 'openstack-integration-test::dns' do expect(chef_run).to disable_service('systemd-resolved') end - [ - /^nameserver 1.0.0.1$/, - /^nameserver 8.8.8.8$/, - ].each do |line| - it do - expect(chef_run).to render_file('/etc/resolv.conf').with_content(line) - end + it do + expect(chef_run).to set_resolver_config('/etc/resolv.conf').with( + nameservers: %w(1.0.0.1 8.8.8.8) + ) end it do