Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix config permissions #90

Merged
merged 6 commits into from
Mar 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ driver:

provisioner:
name: chef_zero
require_chef_omnibus: 13
product_name: chef
product_version: 13
# On CentOS 6, restart the 'postgres' database could fail the first time so
# let's try twice before failing:
# https://github.com/sous-chefs/postgresql/issues/421
Expand Down
16 changes: 8 additions & 8 deletions resources/authoritative_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,6 @@
property :variables, Hash, default: lazy { |resource| { bind_config: "#{resource.config_dir}/bindbackend.conf" } }

action :create do
directory new_resource.config_dir do
owner 'root'
group 'root'
mode '0755'
action :create
end

user new_resource.run_user do
home new_resource.run_user_home
shell new_resource.run_user_shell
Expand All @@ -80,11 +73,18 @@
action :create
end

directory new_resource.config_dir do
owner 'root'
group new_resource.run_group
mode '0755'
action :create
end

template "#{new_resource.config_dir}/#{authoritative_instance_config(new_resource.instance_name)}" do
source new_resource.source
cookbook new_resource.cookbook
owner 'root'
group 'root'
group new_resource.run_group
mode '0640'
variables(
launch: new_resource.launch,
Expand Down
16 changes: 8 additions & 8 deletions resources/recursor_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,6 @@
property :variables, Hash, default: {}

action :create do
directory new_resource.config_dir do
owner 'root'
group 'root'
mode '0755'
action :create
end

user new_resource.run_user do
home new_resource.run_user_home
shell new_resource.run_user_shell
Expand All @@ -79,11 +72,18 @@
action :create
end

directory new_resource.config_dir do
owner 'root'
group new_resource.run_group
mode '0755'
action :create
end

template "#{new_resource.config_dir}/#{recursor_instance_config(new_resource.instance_name)}" do
source new_resource.source
cookbook new_resource.cookbook
owner 'root'
group 'root'
group new_resource.run_group
mode '0640'
variables(
socket_dir: new_resource.socket_dir,
Expand Down
8 changes: 8 additions & 0 deletions test/integration/recursor-multi/default_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,11 @@
describe command('dig -p 54 @127.0.0.1 dnsimple.com') do
its('stdout') { should match(Regexp.new(/\d+\.\d+\.\d+\.\d+/)) }
end

## Regression test for https://github.com/dnsimple/chef-pdns/issues/89
describe command('rec_control --config-name=server_02 --socket-dir=/var/run/server_02 reload-zones') do
its('stdout') { should match('ok') }
its('stdout') { should_not match('unable to parse configuration file') }
its('stdout') { should_not match('Encountered error reloading zones, keeping original data: Unable to re-parse configuration file') }
its('exit_status') { should eq 0 }
end