Skip to content
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
37 changes: 21 additions & 16 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,23 @@
# @param installation_mode
# Specifies which 'installation mode' you want to use to install the IBM Installation Manager. Values: 'administrator', 'nonadministrator', 'group'.
#
# @param install_unzip_package
# Default: true. Installs the unzip package.

class ibm_installation_manager (
$deploy_source = false,
$source = undef,
$source_dir = undef,
$target = undef,
$manage_user = false,
$user = 'root',
$user_home = undef,
$manage_group = false,
$group = 'root',
$options = undef,
$timeout = '900',
$installation_mode = 'administrator',
$deploy_source = false,
$source = undef,
$source_dir = undef,
$target = undef,
$manage_user = false,
$user = 'root',
$user_home = undef,
$manage_group = false,
$group = 'root',
$options = undef,
$timeout = '900',
$installation_mode = 'administrator',
$install_unzip_package = true,
) {

validate_bool($deploy_source)
Expand Down Expand Up @@ -158,10 +162,11 @@
owner => $user,
group => $group,
}

package { 'unzip':
ensure => present,
before => Archive["${_source_dir}/ibm-agent_installer.zip"],
if $install_unzip_package {
package { 'unzip':
ensure => present,
before => Archive["${_source_dir}/ibm-agent_installer.zip"],
}
}

archive { "${_source_dir}/ibm-agent_installer.zip":
Expand Down
28 changes: 28 additions & 0 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,34 @@
}
end

context 'install_unzip_package = true' do
let(:params) do
{
install_unzip_package: true,
deploy_source: true,
source: '/opt/IBM/tmp/InstallationManager/ibm-agent_installer.zip',
}
end

describe 'install_unzip_package set to true' do
it { is_expected.to contain_package('unzip').with(ensure: 'present') }
end
end

context 'install_unzip_package = false' do
let(:params) do
{
install_unzip_package: false,
deploy_source: true,
source: '/opt/IBM/tmp/InstallationManager/ibm-agent_installer.zip',
}
end

describe 'install_unzip_package set to false' do
it { is_expected.not_to contain_package('unzip') }
end
end

context 'deploy source = true' do
let(:params) do
{
Expand Down