Permalink
Browse files

Ensure user and group resources are defined

It is still best to define these resources outside of RVM, but this
should make rvm::system_user work even if the user isn't previously
defined.
  • Loading branch information...
blt04 committed Jan 21, 2012
1 parent 5752c16 commit 6f9fd7136dccc3c95bf2b7194e022ad6b2a092de
Showing with 13 additions and 1 deletion.
  1. +13 −1 manifests/definitions/system_user.pp
@@ -5,8 +5,20 @@
default => 'rvm',
}
+ if ! defined(User[$username]) {
+ user { $username:
+ ensure => present;
+ }
+ }
+
+ if ! defined(Group[$group]) {
+ group { $group:
+ ensure => present;
+ }
+ }
+
exec { "/usr/sbin/usermod -a -G $group $username":
unless => "/bin/cat /etc/group | grep $group | grep $username",
- require => [User[$username], Exec['system-rvm']];
+ require => [User[$username], Group[$group]];
}
}

0 comments on commit 6f9fd71

Please sign in to comment.