Skip to content

Commit

Permalink
Run NoOwnerGroupRoot on the entire codebase: core
Browse files Browse the repository at this point in the history
Summary:
Just run the previous diff on `core` base to clean everything up

```
 $ hg show | grep '^[-+] ' | grep -vEe "^- *(owner|group) *'root'\$" -e  '^\+ *(owner|group) *node.root_(user|group)$'
```
So it literally just changes what it's supposed to.

Differential Revision: D56178482

fbshipit-source-id: c1697841b5188450240b02a3750bd281e837bd1f
  • Loading branch information
Olivier Raginel authored and facebook-github-bot committed Apr 19, 2024
1 parent d81f5ca commit b5406e6
Show file tree
Hide file tree
Showing 68 changed files with 305 additions and 305 deletions.
28 changes: 14 additions & 14 deletions cookbooks/fb_apache/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,16 @@

template sysconfig do
source 'sysconfig.erb'
owner 'root'
group 'root'
owner node.root_user
group node.root_group
mode '0644'
notifies :restart, 'service[apache]'
end

[moddir, sitesdir, confdir].uniq.each do |dir|
directory dir do
owner 'root'
group 'root'
owner node.root_user
group node.root_group
mode '0755'
end
end
Expand Down Expand Up @@ -155,32 +155,32 @@

template "#{moddir}/fb_modules.conf" do
not_if { node.centos6? }
owner 'root'
group 'root'
owner node.root_user
group node.root_group
mode '0644'
notifies :verify, 'fb_apache_verify_configs[doit]', :before
notifies :restart, 'service[apache]'
end

template "#{sitesdir}/fb_sites.conf" do
owner 'root'
group 'root'
owner node.root_user
group node.root_group
mode '0644'
notifies :verify, 'fb_apache_verify_configs[doit]', :before
notifies :reload, 'service[apache]'
end

template "#{confdir}/fb_apache.conf" do
owner 'root'
group 'root'
owner node.root_user
group node.root_group
mode '0644'
notifies :verify, 'fb_apache_verify_configs[doit]', :before
notifies :reload, 'service[apache]'
end

template "#{moddir}/00-mpm.conf" do
owner 'root'
group 'root'
owner node.root_user
group node.root_group
mode '0644'
# MPM cannot be changed on reload, only restart
notifies :verify, 'fb_apache_verify_configs[doit]', :before
Expand All @@ -190,8 +190,8 @@
# We want to collect apache stats
template "#{confdir}/status.conf" do
source 'status.erb'
owner 'root'
group 'root'
owner node.root_user
group node.root_group
mode '0644'
variables(:location => '/server-status')
notifies :verify, 'fb_apache_verify_configs[doit]', :before
Expand Down
8 changes: 4 additions & 4 deletions cookbooks/fb_apcupsd/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@
cookbook_file '/etc/default/apcupsd' do
only_if { node.debian? || node.ubuntu? }
source 'apcupsd'
owner 'root'
group 'root'
owner node.root_user
group node.root_group
mode '0644'
notifies :restart, 'service[apcupsd]'
end

template '/etc/apcupsd/apcupsd.conf' do
source 'apcupsd.conf.erb'
owner 'root'
group 'root'
owner node.root_user
group node.root_group
mode '0644'
notifies :restart, 'service[apcupsd]'
end
Expand Down
4 changes: 2 additions & 2 deletions cookbooks/fb_apcupsd/recipes/frontend.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

template '/etc/apcupsd/hosts.conf' do
source 'hosts.conf.erb'
owner 'root'
group 'root'
owner node.root_user
group node.root_group
mode '0644'
end
8 changes: 4 additions & 4 deletions cookbooks/fb_apt/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
# clobber that as several packages will drop configs there.
template '/etc/apt/apt.conf' do
source 'apt.conf.erb'
owner 'root'
group 'root'
owner node.root_user
group node.root_group
mode '0644'
notifies :run, 'execute[apt-get update]'
end
Expand All @@ -63,8 +63,8 @@

template '/etc/apt/preferences' do
source 'preferences.erb'
owner 'root'
group 'root'
owner node.root_user
group node.root_group
mode '0644'
end

Expand Down
4 changes: 2 additions & 2 deletions cookbooks/fb_apt/resources/sources_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@

template '/etc/apt/sources.list' do
source 'sources.list.erb'
owner 'root'
group 'root'
owner node.root_user
group node.root_group
mode '0644'
end
end
8 changes: 4 additions & 4 deletions cookbooks/fb_apt_cacher/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@

template '/etc/default/apt-cacher-ng' do
source 'apt-cacher-ng.erb'
owner 'root'
group 'root'
owner node.root_user
group node.root_group
mode '0644'
notifies :restart, 'service[apt-cacher-ng]'
end

template '/etc/apt-cacher-ng/acng.conf' do
source 'acng.conf.erb'
owner 'root'
group 'root'
owner node.root_user
group node.root_group
mode '0644'
variables(
:section => 'config',
Expand Down
4 changes: 2 additions & 2 deletions cookbooks/fb_chrony/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
template 'chrony.conf' do
path chrony_conf
source 'chrony.conf.erb'
owner 'root'
group 'root'
owner node.root_user
group node.root_group
mode '0644'
notifies :restart, 'service[chrony]'
end
Expand Down
8 changes: 4 additions & 4 deletions cookbooks/fb_collectd/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
template '/etc/default/collectd' do
only_if { node['platform_family'] == 'debian' }
source 'collectd.erb'
owner 'root'
group 'root'
owner node.root_user
group node.root_group
mode '0644'
notifies :restart, 'service[collectd]'
end
Expand All @@ -54,8 +54,8 @@

template conf do
source 'collectd.conf.erb'
owner 'root'
group 'root'
owner node.root_user
group node.root_group
mode '0644'
notifies :restart, 'service[collectd]'
end
Expand Down
4 changes: 2 additions & 2 deletions cookbooks/fb_collectd/recipes/frontend.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

template conf do
source 'collection.conf.erb'
owner 'root'
group 'root'
owner node.root_user
group node.root_group
mode '0644'
end
26 changes: 13 additions & 13 deletions cookbooks/fb_consul/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,28 +58,28 @@
end
path lazy { node['fb_consul']['config']['data_dir'] }
owner 'consul'
group 'root'
group node.root_group
mode '0770'
end

directory '/etc/consul' do
owner 'root'
group 'root'
owner node.root_user
group node.root_group
mode '0755'
end

cookbook_file '/etc/default/consul' do
source 'consul.default'
owner 'root'
group 'root'
owner node.root_user
group node.root_group
mode '0644'
end

cookbook_file '/etc/consul/consul-agent-ca.pem' do # rubocop:disable Chef/Meta/AvoidCookbookProperty
only_if { node['fb_consul']['certificate_cookbook'] }
cookbook lazy { node['fb_consul']['certificate_cookbook'] }
owner 'root'
group 'root'
owner node.root_user
group node.root_group
mode '0644'
notifies :restart, 'service[consul]'
end
Expand All @@ -91,7 +91,7 @@
end
cookbook lazy { node['fb_consul']['certificate_cookbook'] }
owner 'consul'
group 'root'
group node.root_group
mode '0600'
notifies :restart, 'service[consul]'
end
Expand All @@ -103,8 +103,8 @@
end
cookbook lazy { node['fb_consul']['certificate_cookbook'] }
source "consul-server-#{node['hostname']}.pem"
owner 'root'
group 'root'
owner node.root_user
group node.root_group
mode '0644'
notifies :restart, 'service[consul]'
end
Expand All @@ -117,7 +117,7 @@
cookbook lazy { node['fb_consul']['certificate_cookbook'] }
source "consul-server-key-#{node['hostname']}.pem"
owner 'consul'
group 'root'
group node.root_group
mode '0600'
notifies :restart, 'service[consul]'
end
Expand All @@ -137,8 +137,8 @@
end

template '/etc/consul/consul.json' do
owner 'root'
group 'root'
owner node.root_user
group node.root_group
mode '0644'
source 'consul.json.erb'
verify '/usr/bin/consul validate %{path}'
Expand Down
20 changes: 10 additions & 10 deletions cookbooks/fb_cron/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,16 @@
node['fb_cron']['_crontab_path']
}
source 'fb_crontab.erb'
owner 'root'
group 'root'
owner node.root_user
group node.root_group
mode '0644'
end

template '/etc/anacrontab' do
only_if { node['platform_family'] == 'rhel' }
source 'anacrontab.erb'
owner 'root'
group 'root'
owner node.root_user
group node.root_group
mode '0644'
end

Expand All @@ -114,8 +114,8 @@
if envfile
template envfile do
source 'crond_env.erb'
owner 'root'
group 'root'
owner node.root_user
group node.root_group
mode '0644'
notifies :restart, 'service[cron]'
end
Expand All @@ -142,16 +142,16 @@

cookbook_file '/usr/local/bin/exclusive_cron.sh' do
source 'exclusive_cron.sh'
owner 'root'
group 0
owner node.root_user
group node.root_group
mode '0755'
end

if node.macos?
cookbook_file '/usr/local/bin/osx_make_crond.sh' do
source 'osx_make_crond.sh'
owner 'root'
group 0
owner node.root_user
group node.root_group
mode '0755'
end

Expand Down
8 changes: 4 additions & 4 deletions cookbooks/fb_dbus/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@

directory '/usr/lib/systemd/scripts' do
only_if { node['fb_dbus']['implementation'] == 'dbus-daemon' }
owner 'root'
group 'root'
owner node.root_user
group node.root_group
mode '0755'
end

# Drop in override to force a daemon-reload when dbus restarts (#10321854)
cookbook_file '/usr/lib/systemd/scripts/dbus-restart-hack.sh' do
only_if { node['fb_dbus']['implementation'] == 'dbus-daemon' }
owner 'root'
group 'root'
owner node.root_user
group node.root_group
mode '0755'
end

Expand Down
4 changes: 2 additions & 2 deletions cookbooks/fb_dnf/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
include_recipe 'fb_yum_repos'

directory '/etc/dnf' do
owner 'root'
group 'root'
owner node.root_user
group node.root_group
mode '0755'
end

Expand Down
8 changes: 4 additions & 4 deletions cookbooks/fb_dnf/resources/modularity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@

node['fb_dnf']['modules'].each do |name, mod|
template "#{DEFAULTS_DIR}/#{name}.yaml" do
owner 'root'
group 'root'
owner node.root_user
group node.root_group
mode '0644'
source 'fb_modules.yaml.erb'
variables({ :name => name, :module => mod })
Expand All @@ -37,8 +37,8 @@
"for module '#{name}'"
end
template "#{MODS_DIR}/#{name}.module" do
owner 'root'
group 'root'
owner node.root_user
group node.root_group
mode '0644'
source 'fb_modules.module.erb'
variables({ :name => name, :module => mod })
Expand Down
4 changes: 2 additions & 2 deletions cookbooks/fb_dnsmasq/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@

template '/etc/dnsmasq.conf' do
source 'dnsmasq.conf.erb'
owner 'root'
group 'root'
owner node.root_user
group node.root_group
mode '0644'
verify 'dnsmasq --test -C %{path}'
notifies :restart, 'service[dnsmasq]'
Expand Down
Loading

0 comments on commit b5406e6

Please sign in to comment.