Skip to content

Commit

Permalink
remove exec of wget/curl
Browse files Browse the repository at this point in the history
replaced with a puppet/archive resource.
  • Loading branch information
jhoblitt committed Mar 3, 2016
1 parent 76788d9 commit 77dcd57
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
19 changes: 6 additions & 13 deletions manifests/slave.pp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@

case $::kernel {
'Linux': {
$fetch_command = "wget -O ${slave_home}/${client_jar} ${client_url}/${client_jar}"
$service_name = 'jenkins-slave'
$defaults_user = 'root'
$defaults_group = 'root'
Expand All @@ -186,7 +185,6 @@
}
}
'Darwin': {
$fetch_command = "curl -O ${client_url}/${client_jar}"
$service_name = 'org.jenkins-ci.slave.jnlp'
$defaults_user = 'jenkins'
$defaults_group = 'wheel'
Expand Down Expand Up @@ -253,14 +251,9 @@
}

if ($manage_client_jar) {
exec { 'get_swarm_client':
command => $fetch_command,
path => '/usr/bin:/usr/sbin:/bin:/usr/local/bin',
user => $slave_user,
creates => "${slave_home}/${client_jar}",
cwd => $slave_home,
#refreshonly => true,
## needs to be fixed if you create another version..
archive { 'get_swarm_client':
source => "${client_url}/${client_jar}",
path => "${slave_home}/${client_jar}",
}
}

Expand All @@ -273,12 +266,12 @@
}

if ($manage_client_jar) {
Exec['get_swarm_client'] ->
Service['jenkins-slave']
Archive['get_swarm_client'] ->
Service['jenkins-slave']
}

if $install_java and ($::osfamily != 'Darwin') {
Class['java'] ->
Service['jenkins-slave']
Service['jenkins-slave']
}
}
2 changes: 1 addition & 1 deletion spec/classes/jenkins_slave_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
describe 'jenkins::slave' do

shared_context 'a jenkins::slave catalog' do
it { should contain_exec('get_swarm_client') }
it { should contain_archive('get_swarm_client') }
it { should contain_file(slave_service_file) }
it { should contain_service('jenkins-slave').with(:enable => true, :ensure => 'running') }
it { should contain_user('jenkins-slave_user').with_uid(nil) }
Expand Down

0 comments on commit 77dcd57

Please # to comment.