From: Peter Palfrader Date: Sat, 8 Dec 2012 13:49:35 +0000 (+0100) Subject: Also add static-base class X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=a95dfc2201046441a1b3bc2dc9aeccd1f8020e97;p=mirror%2Fdsa-puppet.git Also add static-base class --- diff --git a/modules/roles/manifests/static_base.pp b/modules/roles/manifests/static_base.pp new file mode 100644 index 000000000..2de3b9b6e --- /dev/null +++ b/modules/roles/manifests/static_base.pp @@ -0,0 +1,11 @@ +class roles::static_base { + if ! $::staticsync_key { + exec { 'create-staticsync-key': + command => '/bin/su - staticsync -c \'mkdir -p -m 02700 .ssh && ssh-keygen -C "`whoami`@`hostname` (`date +%Y-%m-%d`)" -P "" -f .ssh/id_rsa -q\'', + onlyif => '/usr/bin/getent passwd staticsync > /dev/null && ! [ -e /home/staticsync/.ssh/id_rsa ]' + } + } +} +# vim:set et: +# vim:set sts=4 ts=4: +# vim:set shiftwidth=4: diff --git a/modules/roles/manifests/static_master.pp b/modules/roles/manifests/static_master.pp index 6750aa6a9..cd5b061b2 100644 --- a/modules/roles/manifests/static_master.pp +++ b/modules/roles/manifests/static_master.pp @@ -1,4 +1,4 @@ -class roles::static_master inherits roles::mirror_base { +class roles::static_master inherits roles::static_base { file { '/etc/ssh/userkeys/staticsync': content => template('roles/static-master-authorized_keys.erb'), diff --git a/modules/roles/manifests/static_mirror.pp b/modules/roles/manifests/static_mirror.pp index 9b10b1039..bacdc46c1 100644 --- a/modules/roles/manifests/static_mirror.pp +++ b/modules/roles/manifests/static_mirror.pp @@ -1,4 +1,4 @@ -class roles::static_mirror inherits roles::mirror_base { +class roles::static_mirror inherits roles::static_base { file { '/etc/ssh/userkeys/staticsync': content => template('roles/static-mirror-authorized_keys.erb'),