Merge "Improve run_remote_puppet logging output"

This commit is contained in:
Jenkins 2014-04-17 21:50:03 +00:00 committed by Gerrit Code Review
commit 2aaea50685
3 changed files with 15 additions and 4 deletions

View File

@ -77,7 +77,7 @@ class openstack_project::base(
} }
} }
ssh_authorized_key { '/root/.ssh/authorized_keys': ssh_authorized_key { 'puppet-remote-2014-04-17':
ensure => present, ensure => present,
user => 'root', user => 'root',
type => 'ssh-rsa', type => 'ssh-rsa',
@ -88,6 +88,10 @@ class openstack_project::base(
], ],
require => File['/root/.ssh'], require => File['/root/.ssh'],
} }
ssh_authorized_key { '/root/.ssh/authorized_keys':
ensure => absent,
user => 'root',
}
# Use upstream puppet and pin to version 2.7.* # Use upstream puppet and pin to version 2.7.*
if ($::osfamily == 'Debian') { if ($::osfamily == 'Debian') {

View File

@ -18,5 +18,5 @@ class openstack_project::params {
fail("Unsupported osfamily: ${::osfamily} The 'openstack_project' module only supports osfamily Debian or RedHat (slaves only).") fail("Unsupported osfamily: ${::osfamily} The 'openstack_project' module only supports osfamily Debian or RedHat (slaves only).")
} }
} }
$allowed_ssh_command = 'timeout -s 9 30m puppet agent --test' $allowed_ssh_command = 'timeout -s 9 30m puppet agent --onetime --ignorecache --no-daemonize --no-usecacheonfailure --no-splay'
} }

View File

@ -16,8 +16,15 @@
# This function will properly fail if puppet is disabled on the target host # This function will properly fail if puppet is disabled on the target host
function run_ssh { function run_ssh {
echo ssh -o StrictHostKeyChecking=no root@$1 <%= scope.lookupvar('openstack_project::params::allowed_ssh_command') %> echo ssh root@$1 <%= scope.lookupvar('openstack_project::params::allowed_ssh_command') %>
ssh -o StrictHostKeyChecking=no root@$1 <%= scope.lookupvar('openstack_project::params::allowed_ssh_command') %> ssh -o StrictHostKeyChecking=no root@$1 <%= scope.lookupvar('openstack_project::params::allowed_ssh_command') %> >/dev/null
ret=$?
if [ $ret == 124 ] ; then
echo "puppet on $1 timed out"
elif [ $ret != 0 ] ; then
echo "puppet on $1 failed with return code: $ret"
fi
return $ret
} }
export -f run_ssh export -f run_ssh