Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit 6f9fd7136dccc3c95bf2b7194e022ad6b2a092de 1 parent 5752c16
@blt04 blt04 authored
Showing with 13 additions and 1 deletion.
  1. +13 −1 manifests/definitions/system_user.pp
View
14 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]];
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.