Skip to content

Commit

Permalink
Replace hardcoded curl with nanliu-staging's staging::file.
Browse files Browse the repository at this point in the history
This replaces the hardcoded `curl` exec with a more flexible
downloader provided by nanliu-staging.  It can use wget or curl,
and will autodetect the right one to use.
  • Loading branch information
Ashley Penney committed Jan 18, 2014
1 parent 3940e61 commit 9b0d449
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions .fixtures.yml
Expand Up @@ -2,6 +2,7 @@ fixtures:
repositories:
"stdlib": "git://github.com/puppetlabs/puppetlabs-stdlib.git"
"apt": "git://github.com/puppetlabs/puppetlabs-apt.git"
"staging": "git://github.com/nanliu/puppet-staging.git"
erlang:
repo: "https://github.com/garethr/garethr-erlang.git"
symlinks:
Expand Down
1 change: 1 addition & 0 deletions Modulefile
Expand Up @@ -11,3 +11,4 @@ project_page 'http://github.com/puppetlabs/puppetlabs-rabbitmq'
dependency 'puppetlabs/stdlib', '>= 2.0.0'
dependency 'puppetlabs/apt', '>= 1.0.0'
dependency 'garethr/erlang', '>= 0.1.0'
dependency 'nanliu/staging', '>= 0.3.1'
10 changes: 5 additions & 5 deletions manifests/install/rabbitmqadmin.pp
@@ -1,11 +1,11 @@
#
class rabbitmq::install::rabbitmqadmin {

$management_port = $rabbitmq::management_port

exec { 'Download rabbitmqadmin':
command => "curl http://localhost:${management_port}/cli/rabbitmqadmin -o /var/lib/rabbitmq/rabbitmqadmin",
path => '/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin',
creates => '/var/lib/rabbitmq/rabbitmqadmin',
staging::file { 'rabbitmqadmin':
target => '/var/lib/rabbitmq/rabbitmqadmin',
source => "http://localhost:${management_port}/cli/rabbitmqadmin",
require => [
Class['rabbitmq::service'],
Rabbitmq_plugin['rabbitmq_management']
Expand All @@ -17,7 +17,7 @@
group => 'root',
source => '/var/lib/rabbitmq/rabbitmqadmin',
mode => '0755',
require => Exec['Download rabbitmqadmin'],
require => Staging::File['rabbitmqadmin'],
}

}
1 change: 1 addition & 0 deletions spec/spec_helper_system.rb
Expand Up @@ -29,5 +29,6 @@
shell('puppet module install garethr-erlang')
shell('puppet module install puppetlabs-stdlib')
shell('puppet module install puppetlabs-apt')
shell('puppet module install nanliu-staging')
end
end

0 comments on commit 9b0d449

Please sign in to comment.