Skip to content

Commit

Permalink
Allow and remove old yumstage key
Browse files Browse the repository at this point in the history
  • Loading branch information
ehelms committed Sep 13, 2023
1 parent fe10eda commit a380fd8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions puppet/modules/secure_ssh/manifests/rsync/uploader_key.pp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@
Stdlib::Absolutepath $dir = "/home/${user}/.ssh",
Stdlib::Filemode $mode = '0600',
Boolean $manage_dir = false,
String[1] $ensure = 'present',
) {
secure_ssh::uploader_key { $name:
ensure => $ensure,
user => $user,
dir => $dir,
mode => $mode,
Expand Down
3 changes: 3 additions & 0 deletions puppet/modules/secure_ssh/manifests/uploader_key.pp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
Stdlib::Filemode $mode = '0600',
Boolean $manage_dir = false,
String[1] $ssh_key_name = "${name}_key",
String[1] $ensure = 'present',
) {
$pub_key = ssh::keygen($ssh_key_name, true)
$priv_key = ssh::keygen($ssh_key_name)
Expand All @@ -34,12 +35,14 @@
}

file { "${dir}/${ssh_key_name}":
ensure => $ensure,
owner => $user,
mode => '0400',
content => $priv_key,
}

file { "${dir}/${ssh_key_name}.pub":
ensure => $ensure,
owner => $user,
mode => '0644',
content => "ssh-rsa ${pub_key} ${ssh_key_name} from puppetmaster\n",
Expand Down
5 changes: 5 additions & 0 deletions puppet/modules/slave/manifests/packaging/rpm.pp
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,9 @@
}

include rsync

secure_ssh::rsync::uploader_key { 'yumstage':
ensure => 'absent',
user => $user,
}
}

0 comments on commit a380fd8

Please sign in to comment.