aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Scherer <misc@mageia.org>2012-04-02 11:05:27 +0000
committerMichael Scherer <misc@mageia.org>2012-04-02 11:05:27 +0000
commit40a4dd3827395ce6f7c1cf6ee675a438430d3820 (patch)
treefd6ce976955259b49151a2bc516a373bfcf48d16
parent7a0ccee0daa151005bab303a790b1fae7385535a (diff)
downloadpuppet-40a4dd3827395ce6f7c1cf6ee675a438430d3820.tar
puppet-40a4dd3827395ce6f7c1cf6ee675a438430d3820.tar.gz
puppet-40a4dd3827395ce6f7c1cf6ee675a438430d3820.tar.bz2
puppet-40a4dd3827395ce6f7c1cf6ee675a438430d3820.tar.xz
puppet-40a4dd3827395ce6f7c1cf6ee675a438430d3820.zip
split a module pubkeys_directory, so we can include it from symlink_user and make sure everything is correctly declared
-rw-r--r--modules/openssh/manifests/pubkeys_directory.pp17
-rw-r--r--modules/openssh/manifests/ssh_keys_from_ldap.pp17
-rw-r--r--modules/openssh/manifests/symlink_user.pp2
3 files changed, 20 insertions, 16 deletions
diff --git a/modules/openssh/manifests/pubkeys_directory.pp b/modules/openssh/manifests/pubkeys_directory.pp
new file mode 100644
index 00000000..cbcaeb88
--- /dev/null
+++ b/modules/openssh/manifests/pubkeys_directory.pp
@@ -0,0 +1,17 @@
+class openssh::pubkeys_directory {
+ $pubkeys_directory = '/var/lib/pubkeys'
+ file { $pubkeys_directory:
+ ensure => directory,
+ }
+
+ file { "$pubkeys_directory/root":
+ ensure => directory,
+ mode => '0700',
+ }
+
+ file { "$pubkeys_directory/root/authorized_keys":
+ ensure => link,
+ target => '/root/.ssh/authorized_keys',
+ mode => '0700',
+ }
+}
diff --git a/modules/openssh/manifests/ssh_keys_from_ldap.pp b/modules/openssh/manifests/ssh_keys_from_ldap.pp
index 720f4481..b466bab3 100644
--- a/modules/openssh/manifests/ssh_keys_from_ldap.pp
+++ b/modules/openssh/manifests/ssh_keys_from_ldap.pp
@@ -9,22 +9,7 @@ class openssh::ssh_keys_from_ldap($symlink_users = [],
package { 'python-ldap': }
- $pubkeys_directory = '/var/lib/pubkeys'
- file { $pubkeys_directory:
- ensure => directory,
- }
-
- file { "$pubkeys_directory/root":
- ensure => directory,
- mode => '0700',
- }
-
- file { "$pubkeys_directory/root/authorized_keys":
- ensure => link,
- target => '/root/.ssh/authorized_keys',
- mode => '0700',
- }
-
+ include openssh::pubkeys_directory
symlink_user { $symlink_users: }
$ldap_pwfile = '/etc/ldap.secret'
diff --git a/modules/openssh/manifests/symlink_user.pp b/modules/openssh/manifests/symlink_user.pp
index f4ec942f..f2e107b1 100644
--- a/modules/openssh/manifests/symlink_user.pp
+++ b/modules/openssh/manifests/symlink_user.pp
@@ -1,4 +1,6 @@
define openssh::symlink_user() {
+ include openssh::pubkeys_directory
+ $pubkeys_directory = $openssh::pubkeys_directory::pubkeys_directory
file { "$pubkeys_directory/$name":
ensure => directory,
owner => $name,