diff options
-rw-r--r-- | manifests/instance.pp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/manifests/instance.pp b/manifests/instance.pp index 28add12..31a6431 100644 --- a/manifests/instance.pp +++ b/manifests/instance.pp @@ -1,7 +1,7 @@ define ikiwiki::instance($base_url = $domain, $ensure = 'present', $description = false, $adminuser = 'yourname', $adminemail = 'me@example.org', $instance = 'ikiwiki', $account_creation_password = false, $add_plugins = false, $disable_plugins = false, - $protocol = 'https', $owner = $name, $group = $name) { + $protocol = 'https', $owner = $name, $group = $name, $home = "/home/$name") { $desc = $description ? { false => $title, @@ -26,11 +26,11 @@ define ikiwiki::instance($base_url = $domain, $ensure = 'present', $description } exec { "ssh-keygen-ikiwiki-${name}_${instance}": - command => "ssh-keygen -t rsa -P '' -f ${ikiwiki::sites_folder}/${name}/.ssh/id_rsa", - creates => "${ikiwiki::sites_folder}/${name}/.ssh/id_rsa", + command => "ssh-keygen -t rsa -P '' -f ${home}/.ssh/id_rsa", + creates => "${home}/.ssh/id_rsa", user => $owner, group => $group, - require => File["${ikiwiki::sites_folder}/${name}/.ssh"], + require => File["${home}/.ssh"], } if !defined(File["${ikiwiki::sites_folder}/${name}/${instance}_src"]) { @@ -54,13 +54,12 @@ define ikiwiki::instance($base_url = $domain, $ensure = 'present', $description } } - if !defined(File["${ikiwiki::sites_folder}/${name}/.ssh"]) { - file { "${ikiwiki::sites_folder}/${name}/.ssh": + if !defined(File["${home}/.ssh"]) { + file { "${home}/.ssh": ensure => directory, owner => $owner, group => $group, mode => 0700, - require => File["${ikiwiki::sites_folder}/${name}"], } } |