From 1144fd8d7c11203ef797d7e7dd905bcb6e22b70c Mon Sep 17 00:00:00 2001 From: "Eric D. Helms" Date: Sun, 27 Aug 2023 12:21:10 -0400 Subject: [PATCH] Allow and remove old yumstage key --- puppet/modules/secure_ssh/manifests/rsync/uploader_key.pp | 2 ++ puppet/modules/secure_ssh/manifests/uploader_key.pp | 3 +++ puppet/modules/slave/manifests/packaging/rpm.pp | 5 +++++ 3 files changed, 10 insertions(+) diff --git a/puppet/modules/secure_ssh/manifests/rsync/uploader_key.pp b/puppet/modules/secure_ssh/manifests/rsync/uploader_key.pp index b7a6b663f..a2c97046b 100644 --- a/puppet/modules/secure_ssh/manifests/rsync/uploader_key.pp +++ b/puppet/modules/secure_ssh/manifests/rsync/uploader_key.pp @@ -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, diff --git a/puppet/modules/secure_ssh/manifests/uploader_key.pp b/puppet/modules/secure_ssh/manifests/uploader_key.pp index d8d326132..48aa1e882 100644 --- a/puppet/modules/secure_ssh/manifests/uploader_key.pp +++ b/puppet/modules/secure_ssh/manifests/uploader_key.pp @@ -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) @@ -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", diff --git a/puppet/modules/slave/manifests/packaging/rpm.pp b/puppet/modules/slave/manifests/packaging/rpm.pp index f44228c6b..25f7d9f1c 100644 --- a/puppet/modules/slave/manifests/packaging/rpm.pp +++ b/puppet/modules/slave/manifests/packaging/rpm.pp @@ -111,4 +111,9 @@ } include rsync + + secure_ssh::rsync::uploader_key { 'yumstage': + ensure => 'absent', + user => $user, + } }