6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
# File 'manifests/internal/deployuser.pp', line 6
class cfweb::internal::deployuser {
$deployuser = $cfweb::deployuser
$deployuser_auth_keys = $cfweb::deployuser_auth_keys
$deploy_command = "${cfweb::nginx::bin_dir}/deploy"
#======================================================================
group { $deployuser: ensure => present }
user { $deployuser:
ensure => present,
groups => ['ssh_access'],
home => "/home/${deployuser}",
managehome => true,
purge_ssh_keys => true,
membership => inclusive,
require => Group['ssh_access'],
}
file {"/home/${deployuser}/deployweb.sh":
owner => $deployuser,
group => $deployuser,
mode => '0750',
content => @("EOT"/$)
#!/bin/sh
sudo ${deploy_command} \$1
|EOT
}
cfauth::sudoentry { $deployuser:
command => $deploy_command,
}
if $deployuser_auth_keys {
create_resources(
ssh_authorized_key,
prefix($deployuser_auth_keys, "${deployuser}@"),
{
user => $deployuser,
'type' => 'ssh-rsa',
require => User[$deployuser],
}
)
}
#======================================================================
}
|