aboutsummaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
Diffstat (limited to 'manifests')
-rw-r--r--manifests/defines/ssh_config.pp7
-rw-r--r--manifests/defines/ssh_create_key.pp6
-rw-r--r--manifests/defines/ssh_known_hosts.pp6
-rw-r--r--manifests/defines/ssh_local_key.pp6
-rw-r--r--manifests/subsystem/ssh_folder.pp6
5 files changed, 26 insertions, 5 deletions
diff --git a/manifests/defines/ssh_config.pp b/manifests/defines/ssh_config.pp
index 79d9635..d071822 100644
--- a/manifests/defines/ssh_config.pp
+++ b/manifests/defines/ssh_config.pp
@@ -1,10 +1,15 @@
# Manage ssh config for a particular user
define ssh_config(
$owner,
+ $group,
$home = '/home/$owner',
$ssh_localhost_auth = false
) {
- include nodo::subsystem::ssh_folder
+ class { "nodo::subsystem::ssh_folder":
+ home => $home,
+ owner => $owner,
+ group => $group,
+ }
file { "${home}/.ssh/config":
ensure => present,
diff --git a/manifests/defines/ssh_create_key.pp b/manifests/defines/ssh_create_key.pp
index ec4bb67..3608b7e 100644
--- a/manifests/defines/ssh_create_key.pp
+++ b/manifests/defines/ssh_create_key.pp
@@ -4,7 +4,11 @@ define ssh_create_key(
$keyfile = 'id_rsa',
$home = '/home/$owner'
) {
- include nodo::subsystem::ssh_folder
+ class { "nodo::subsystem::ssh_folder":
+ home => $home,
+ owner => $owner,
+ group => $group,
+ }
exec { "ssh-keygen-${owner}":
command => "ssh-keygen -t rsa -P '' -f ${home}/.ssh/${keyfile}",
diff --git a/manifests/defines/ssh_known_hosts.pp b/manifests/defines/ssh_known_hosts.pp
index 84f25b2..dad17ac 100644
--- a/manifests/defines/ssh_known_hosts.pp
+++ b/manifests/defines/ssh_known_hosts.pp
@@ -4,7 +4,11 @@ define ssh_known_host(
$home = '/home/$owner',
$ssh_localhost_auth = false
) {
- include nodo::subsystem::ssh_folder
+ class { "nodo::subsystem::ssh_folder":
+ home => $home,
+ owner => $owner,
+ group => $group,
+ }
file { "${home}/.ssh/known_hosts":
ensure => present,
diff --git a/manifests/defines/ssh_local_key.pp b/manifests/defines/ssh_local_key.pp
index be6ccd8..99d8361 100644
--- a/manifests/defines/ssh_local_key.pp
+++ b/manifests/defines/ssh_local_key.pp
@@ -7,7 +7,11 @@ define ssh_local_key(
$dest = 'id_rsa',
$ensure = 'present',
) {
- include nodo::subsystem::ssh_folder
+ class { "nodo::subsystem::ssh_folder":
+ home => $home,
+ owner => $owner,
+ group => $group,
+ }
file { "${home}/.ssh/${dest}":
ensure => $ensure,
diff --git a/manifests/subsystem/ssh_folder.pp b/manifests/subsystem/ssh_folder.pp
index 1c6ee49..89e91a6 100644
--- a/manifests/subsystem/ssh_folder.pp
+++ b/manifests/subsystem/ssh_folder.pp
@@ -1,5 +1,9 @@
# Base class
-class nodo::subsystem::ssh_folder {
+class nodo::subsystem::ssh_folder(
+ $home,
+ $owner,
+ $group,
+) {
if !defined(File["${home}/.ssh"]) {
file { "${home}/.ssh":
ensure => directory,