Skip to content

Commit

Permalink
use ensure_resource for common resources
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey-mp committed Nov 18, 2016
1 parent e7a0150 commit c132792
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 15 deletions.
14 changes: 4 additions & 10 deletions manifests/common_server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,14 @@
)
{
if $::osfamily == 'RedHat' {
package { ['libaio', 'numactl', 'wget']:
ensure => installed,
}
ensure_resource('package', ['libaio', 'numactl', 'wget'], {'ensure' => 'installed'})
if $ensure_java == 'present' {
package { 'java-1.8.0-openjdk':
ensure => installed,
}
ensure_resource('package', 'java-1.8.0-openjdk', {'ensure' => 'installed'})
}
}
elsif $::osfamily == 'Debian' {
package { ['libaio1', 'numactl', 'wget']:
ensure => installed,
}
if $ensure_java == 'present' {
ensure_resource('package', ['libaio1', 'numactl', 'wget'], {'ensure' => 'installed'})
if $ensure_java == 'present' and ! defined(Exec['add java8 repo']) {
Exec { path => [ '/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/' ] }
# Below are a java 1.8 installation steps which shouldn't be required for newer Ubuntu versions
exec { 'add java8 repo':
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/scaleio_sdc_server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"repo_user" => 'QNzgdxXix',
"repo_password" => 'Aw3wFAwAq3',
"local_dir" => '/bin/emc/scaleio/scini_sync/driver_cache/',
"module_sigcheck" => 1,
"module_sigcheck" => 0,
"emc_public_gpg_key" => '/bin/emc/scaleio/scini_sync/RPM-GPG-KEY-ScaleIO',
"repo_public_rsa_key" => '/bin/emc/scaleio/scini_sync/scini_repo_key.pub',
"sync_pattern" => '.*',
Expand Down
4 changes: 2 additions & 2 deletions spec/classes/scaleio_sds_server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"repo_user" => 'QNzgdxXix',
"repo_password" => 'Aw3wFAwAq3',
"local_dir" => '/bin/emc/scaleio/xcache_sync/driver_cache/',
"module_sigcheck" => 1,
"module_sigcheck" => 0,
"emc_public_gpg_key" => '/bin/emc/scaleio/xcache_sync/RPM-GPG-KEY-ScaleIO',
"repo_public_rsa_key" => '/bin/emc/scaleio/xcache_sync/xcache_repo_key.pub',
"sync_pattern" => '.*'})
Expand Down Expand Up @@ -113,7 +113,7 @@
:ensure => 'present',
:path => '/bin/emc/scaleio/xcache_sync/driver_sync.conf',
:match => '^module_sigcheck',
:line => 'module_sigcheck=1')
:line => 'module_sigcheck=0')
is_expected.to contain_config_sync('repo_address').with(
:driver => 'xcache',
:config => sync_conf)
Expand Down
4 changes: 2 additions & 2 deletions spec/defines/scaleio_driver_sync_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"repo_user" => 'QNzgdxXix',
"repo_password" => 'Aw3wFAwAq3',
"local_dir" => '/bin/emc/scaleio/scini_sync/driver_cache/',
"module_sigcheck" => 1,
"module_sigcheck" => 0,
"emc_public_gpg_key" => '/bin/emc/scaleio/scini_sync/RPM-GPG-KEY-ScaleIO',
"repo_public_rsa_key" => '/bin/emc/scaleio/scini_sync/scini_repo_key.pub',
"sync_pattern" => '.*',
Expand Down Expand Up @@ -59,7 +59,7 @@
:ensure => 'present',
:path => '/bin/emc/scaleio/scini_sync/driver_sync.conf',
:match => '^module_sigcheck',
:line => 'module_sigcheck=1')}
:line => 'module_sigcheck=0')}
it { is_expected.to contain_config_sync('repo_address').with(
:driver => 'scini',
:config => sync_conf)}
Expand Down

0 comments on commit c132792

Please sign in to comment.