Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: modules/adblockplus/manifests/user.pp

Issue 29338467: Issue 3587 - Unlink adblockplus::user from users::user (Closed)
Patch Set: Created March 16, 2016, 6:30 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: modules/adblockplus/manifests/user.pp
diff --git a/modules/adblockplus/manifests/user.pp b/modules/adblockplus/manifests/user.pp
index fe0f0a0d74b43f38b5aba7ff104f4c60d71ef2fd..af648581914629f983620914d53ea422bb758b00 100644
--- a/modules/adblockplus/manifests/user.pp
+++ b/modules/adblockplus/manifests/user.pp
@@ -32,6 +32,7 @@
#
define adblockplus::user (
$authorized_keys = [],
+ $ensure = 'present',
$groups = [],
$password_hash = undef,
) {
@@ -39,10 +40,33 @@ define adblockplus::user (
include adblockplus
include users
- users::user {"adblockplus::user#$name":
- authorized_keys => join($authorized_keys, "\n"),
+ # Re-used multiple times below
+ $home = "/home/$name"
+
+ user {$name:
+ ensure => $ensure,
groups => $groups,
+ home => $home,
+ managehome => true,
password => $password_hash,
- user_name => $name,
+ shell => '/bin/bash',
+ }
+
+ file {"$home/.ssh":
+ ensure => $ensure ? {
+ 'present' => 'directory',
+ default => $ensure,
+ },
+ mode => 0700,
+ owner => $name,
+ require => User[$name],
+ }
+
+ file {"$home/.ssh/authorized_keys":
+ content => join($authorized_keys, "\n"),
+ ensure => $ensure,
+ mode => 0644,
+ owner => $name,
+ require => File["$home/.ssh"],
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld