Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unzip depedency for staging #166

Merged
merged 1 commit into from
Aug 11, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
case $consul::install_method {
'url': {
if $::operatingsystem != 'darwin' {
ensure_packages(['unzip'])
ensure_packages(['unzip'], { 'before' => Staging::File['consul.zip'] })
}
staging::file { 'consul.zip':
source => $consul::real_download_url
Expand All @@ -32,6 +32,9 @@
}

if ($consul::ui_dir and $consul::data_dir) {
if $::operatingsystem != 'darwin' {
Package['unzip'] -> Staging::Deploy['consul_web_ui.zip']
}
file { "${consul::data_dir}/${consul::version}_web_ui":
ensure => 'directory',
owner => 'root',
Expand Down
19 changes: 19 additions & 0 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,25 @@
it { should_not contain_exec('join consul wan') }
end

context 'Require unzip package when installing via URL' do
it { should contain_staging__file('consul.zip').that_requires('Package[unzip]') }
end

context "Require unzip package when installing UI via URL" do
let(:params) {{
:config_hash => {
'data_dir' => '/dir1',
'ui_dir' => '/dir1/dir2',
},
}}
it { should contain_staging__deploy('consul_web_ui.zip').that_requires('Package[unzip]') }
end

context 'OS X should not contain unzip package' do
let(:facts) {{ :operatingsystem => 'darwin' }}
it { should_not contain_package('unzip') }
end

context 'When requesting to install via a package with defaults' do
let(:params) {{
:install_method => 'package'
Expand Down