Skip to content

Commit

Permalink
Make the procs by platform
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorific committed Sep 26, 2024
1 parent 2ba0fbd commit 11b49b5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
35 changes: 19 additions & 16 deletions cookbooks/boxcutter_site_settings/recipes/users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,22 @@
FB::Users.initialize_group(node, group)
end

node.default['fb_users']['users']['nobody'] = {
'shell' => '/usr/sbin/nologin',
'gid' => 'nogroup',
'home' => '/nonexistent',
'action' => :add,
'only_if' => proc { node.ubuntu? }
}

node.default['fb_users']['users']['nobody'] = {
'comment' => 'Kernel Overflow User',
'shell' => '/usr/sbin/nologin',
'gid' => '65534',
'home' => '/',
'action' => :add,
'only_if' => proc { node.centos? }
}
case node['platform']
when 'ubuntu'
node.default['fb_users']['users']['nobody'] = {
'shell' => '/usr/sbin/nologin',
'gid' => 'nogroup',
'home' => '/nonexistent',
'action' => :add,
'only_if' => proc { node.ubuntu? },
}
when 'centos'
node.default['fb_users']['users']['nobody'] = {
'comment' => 'Kernel Overflow User',
'shell' => '/usr/sbin/nologin',
'gid' => '65534',
'home' => '/',
'action' => :add,
'only_if' => proc { node.centos? },
}
end
2 changes: 1 addition & 1 deletion cookbooks/boxcutter_users/libraries/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,6 @@ class Users
'nogroup' => {
'gid' => 65534,
},
}
}.freeze
end
end

0 comments on commit 11b49b5

Please sign in to comment.