From 541fac117b191a93dfa13566fee024eeb86df008 Mon Sep 17 00:00:00 2001 From: K Jonathan Harker Date: Fri, 23 May 2014 11:55:20 -0700 Subject: [PATCH] Move jenkins-sudo bits to openstack_project The jenkins-sudo privileges are specific to the slave_scripts directory, which has already been moved to the openstack_project. Let's keep these two things together. Change-Id: I0ef16850bf97d54f1ac92e41e5bd31e7f6f40ea9 --- modules/jenkins/manifests/slave.pp | 19 ------------------- .../manifests/single_use_slave.pp | 2 +- .../manifests/slave_common.pp | 19 +++++++++++++++++++ 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/modules/jenkins/manifests/slave.pp b/modules/jenkins/manifests/slave.pp index d83d815a0d..e8e958dbec 100644 --- a/modules/jenkins/manifests/slave.pp +++ b/modules/jenkins/manifests/slave.pp @@ -2,7 +2,6 @@ # class jenkins::slave( $ssh_key = '', - $sudo = false, $user = true, $python3 = false, ) { @@ -179,22 +178,4 @@ class jenkins::slave( group => 'root', mode => '0755', } - - if ($sudo == true) { - file { '/etc/sudoers.d/jenkins-sudo': - ensure => present, - source => 'puppet:///modules/jenkins/jenkins-sudo.sudo', - owner => 'root', - group => 'root', - mode => '0440', - } - } - - file { '/etc/sudoers.d/jenkins-sudo-grep': - ensure => present, - source => 'puppet:///modules/jenkins/jenkins-sudo-grep.sudo', - owner => 'root', - group => 'root', - mode => '0440', - } } diff --git a/modules/openstack_project/manifests/single_use_slave.pp b/modules/openstack_project/manifests/single_use_slave.pp index aec27e58ed..2616181c0b 100644 --- a/modules/openstack_project/manifests/single_use_slave.pp +++ b/modules/openstack_project/manifests/single_use_slave.pp @@ -36,12 +36,12 @@ class openstack_project::single_use_slave ( } class { 'jenkins::slave': ssh_key => $ssh_key, - sudo => $sudo, python3 => $python3, } class { 'openstack_project::slave_common': include_pypy => $include_pypy, + sudo => $sudo, } if (! $thin) { diff --git a/modules/openstack_project/manifests/slave_common.pp b/modules/openstack_project/manifests/slave_common.pp index dc7bc8185a..626f9fe37a 100644 --- a/modules/openstack_project/manifests/slave_common.pp +++ b/modules/openstack_project/manifests/slave_common.pp @@ -4,6 +4,7 @@ # openstack_project::single_use_slave class openstack_project::slave_common( $include_pypy = false, + $sudo = false, ){ vcsrepo { '/opt/requirements': ensure => latest, @@ -24,6 +25,24 @@ class openstack_project::slave_common( source => 'puppet:///modules/openstack_project/slave_scripts', } + if ($sudo == true) { + file { '/etc/sudoers.d/jenkins-sudo': + ensure => present, + source => 'puppet:///modules/openstack_project/jenkins-sudo.sudo', + owner => 'root', + group => 'root', + mode => '0440', + } + } + + file { '/etc/sudoers.d/jenkins-sudo-grep': + ensure => present, + source => 'puppet:///modules/openstack_project/jenkins-sudo-grep.sudo', + owner => 'root', + group => 'root', + mode => '0440', + } + # Temporary for debugging glance launch problem # https://lists.launchpad.net/openstack/msg13381.html # NOTE(dprince): ubuntu only as RHEL6 doesn't have sysctl.d yet