diff --git a/modules/jenkins_slave/manifests/slavecirepo.pp b/modules/jenkins_slave/manifests/slavecirepo.pp index e664c6a943..47120b654d 100644 --- a/modules/jenkins_slave/manifests/slavecirepo.pp +++ b/modules/jenkins_slave/manifests/slavecirepo.pp @@ -5,18 +5,18 @@ define slavecirepo($ensure = present) { exec { "Clone openstack-ci git repo": path => "/bin:/usr/bin", environment => "HOME=/home/jenkins", - command => "git clone git://github.com/openstack/openstack-ci.git /home/jenkins/openstack-ci", - user => "jenkins", - group => "jenkins", + command => "sudo -H -u jenkins -i git clone git://github.com/openstack/openstack-ci.git /home/jenkins/openstack-ci", + user => "root", + group => "root", unless => "$repo_there", logoutput => on_failure, } exec { "Update openstack-ci git repo": path => "/bin:/usr/bin", environment => "HOME=/home/jenkins", - command => "bash -c 'cd /home/jenkins/openstack-ci && git pull'", - user => "jenkins", - group => "jenkins", + command => "sudo -H -u jenkins -i bash -c 'cd /home/jenkins/openstack-ci && git pull'", + user => "root", + group => "root", onlyif => "$repo_there", logoutput => on_failure, }