Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $users = generate("/bin/bash", "-c", "awk -F':' '{if (\$3 >= 500 && \$3 != 65534) print \$1}' /etc/passwd")
- $users_array = split($users, '\n')
- file { '/state/partition1/scratch':
- ensure => 'directory',
- mode => '0777',
- }
- file { '/scratch':
- ensure => 'link',
- target => '/state/partition1/scratch',
- require => File["/state/partition1/scratch"],
- }
- $users_array.each |String $user| {
- file { "/scratch/$user":
- ensure => 'directory',
- mode => '0700',
- owner => "$user",
- group => "$user",
- require => File["/scratch"],
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement