aboutsummaryrefslogtreecommitdiff
path: root/manifests/defines/ssh_local_key.pp
blob: f2828a2ecc226918b9383c13efa8b51e07d2b3e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Manage local ssh keys
define ssh_local_key(
  $owner  = $name,
  $group  = $name,
  $home   = "/home/${owner}",
  $source = "puppet:///modules/site_keys/${name}_id_rsa",
  $dest   = 'id_rsa',
  $ensure = 'present',
) {
  ssh_folder { "ssh_local_key-${name}":
    home  => $home,
    owner => $owner,
    group => $group,
  }

  file { "${home}/.ssh/${dest}":
    ensure  => $ensure,
    owner   => $owner,
    group   => $group,
    mode    => 0400,
    source  => "$source",
    require => File["${home}/.ssh"],
  }
}