-
-
Save jayangshu84/e4b230f0a72b9c4f71075d581590bc41 to your computer and use it in GitHub Desktop.
Final (simplified) defined type for creating virtual user acounts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Defined type for creating virtual user accounts | |
# | |
define accounts::virtual ($uid,$realname,$pass) { | |
user { $title: | |
ensure => 'present', | |
uid => $uid, | |
gid => $title, | |
shell => '/bin/bash', | |
home => "/home/${title}", | |
comment => $realname, | |
password => $pass, | |
managehome => true, | |
require => Group[$title], | |
} | |
group { $title: | |
gid => $uid, | |
} | |
file { "/home/${title}": | |
ensure => directory, | |
owner => $title, | |
group => $title, | |
mode => 0750, | |
require => [ User[$title], Group[$title] ], | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment