Added more support for $vmware_admin_group variable.

This commit is contained in:
Timo Mkinen 2009-11-24 22:59:54 +02:00
parent a2e7cc65b5
commit 0a845626b0

View file

@ -48,13 +48,20 @@ class vmware::server {
Class["puppet::client"], ],
notify => Exec["restart-vmware-mgmt"],
}
exec { "restart-vmware-mgmt":
command => "/etc/init.d/vmware-mgmt restart && sleep 10",
path => "/bin:/usr/bin:/sbin:/usr/sbin",
user => root,
refreshonly => true,
}
exec { "vmware-admin-add-${vmware_admin_group}":
command => "/usr/bin/vmware-vim-cmd vimsvc/auth/entity_permission_add 'vim.Folder:ha-folder-root' '${vmware_admin_group}' 'true' 'Admin' 'true'",
path => "/bin:/usr/bin:/sbin:/usr/sbin",
user => root,
unless => "/usr/bin/vmware-vim-cmd vimsvc/auth/entity_permissions 'vim.Folder:ha-folder-root' | egrep 'principal|roleId' | cut -d= -f2 | sed -e 'N;s/\\n/ /' | fgrep -- -1 | grep '\"${vmware_admin_group}\"'",
require => Service["vmware"],
}
}
}