Skip to content

Commit

Permalink
review bits
Browse files Browse the repository at this point in the history
  • Loading branch information
jaymzh committed May 14, 2020
1 parent f1e09ab commit ebc6365
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion cookbooks/fb_networkmanager/attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
},
'ifupdown' => {
# yup... this boolean does NOT take true/false like others,
# but instead yes/no. Since there's no programatic way to know
# but instead yes/no. Since there's no programmatic way to know
# when true/false is wanted vs yes/no, we leave it up to the user
# to specify the right one at the right time.
#
Expand Down
28 changes: 17 additions & 11 deletions cookbooks/fb_networkmanager/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,23 @@
# limitations under the License.
#

vpnhome = '/var/lib/openvpn/chroot'
FB::Users.initialize_group(node, 'nm-openvpn')
node.default['fb_users']['users']['nm-openvpn'] = {
'gid' => 'nm-openvpn',
# If /var/lib/openvpn doesn't exist yet, we can't create it in time
# but we want to create the user, so for the first run, create it
# with /tmp
'home' => ::File.directory?(vpnhome) ? vpnhome : '/tmp',
'shell' => '/usr/sbin/nologin',
'action' => :add,
}
unless node.ubuntu? || node.debian?
fail 'fb_networkmanager: Only Ubuntu or Debian are currently supported'
end

if node['fb_users']
vpnhome = '/var/lib/openvpn/chroot'
FB::Users.initialize_group(node, 'nm-openvpn')
node.default['fb_users']['users']['nm-openvpn'] = {
'gid' => 'nm-openvpn',
# If /var/lib/openvpn doesn't exist yet, we can't create it in time
# but we want to create the user, so for the first run, create it
# with /tmp
'home' => ::File.directory?(vpnhome) ? vpnhome : '/tmp',
'shell' => '/usr/sbin/nologin',
'action' => :add,
}
end

packages = %w{
network-manager
Expand Down

0 comments on commit ebc6365

Please sign in to comment.