diff --git a/manifests/params.pp b/manifests/params.pp index 46c57976..cc451e82 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -45,7 +45,7 @@ # can be set to the user field that is in the group group_field $oned_ldap_user_group_field = hiera('one::oned::ldap_user_group_field','undef'), # should we enable opennebula repos? - $one_repo_enable = hiera('one::enable_opennebula_repo', true ), + $one_repo_enable = hiera('one::enable_opennebula_repo', 'true' ), $backup_script_path = hiera ('one::oned::backup::script_path', '/var/lib/one/bin/one_db_backup.sh'), $ssh_priv_key_param = hiera('one::head::ssh_priv_key',undef), diff --git a/manifests/prerequisites.pp b/manifests/prerequisites.pp index 1583994e..f157c102 100644 --- a/manifests/prerequisites.pp +++ b/manifests/prerequisites.pp @@ -21,7 +21,7 @@ class one::prerequisites { case $::osfamily { 'RedHat': { - if ( $one::params::one_repo_enable == true ) { + if ( $one::params::one_repo_enable == 'true' ) { yumrepo { 'opennebula': baseurl => 'http://downloads.opennebula.org/repo/4.10/CentOS/6/x86_64/', descr => 'OpenNebula', @@ -31,36 +31,36 @@ } } 'Debian' : { - if ($one::params::one_repo_enable == true) { - include ::apt - case $::operatingsystem { - 'Debian': { - $apt_location="4.10/Debian/${::lsbmajdistrelease}" - $apt_pin='-10' - } - 'Ubuntu': { - $apt_location="4.10/Ubuntu/${::lsbdistrelease}" - $apt_pin='500' - } - default: { fail("Unrecognized operating system ${::operatingsystem}") } - } + if ($one::params::one_repo_enable == 'true') { + include ::apt + case $::operatingsystem { + 'Debian': { + $apt_location="4.10/Debian/${::lsbmajdistrelease}" + $apt_pin='-10' + } + 'Ubuntu': { + $apt_location="4.10/Ubuntu/${::lsbdistrelease}" + $apt_pin='500' + } + default: { fail("Unrecognized operating system ${::operatingsystem}") } + } - apt::source { 'one-official': - location => "http://downloads.opennebula.org/repo/${apt_location}", - release => 'stable', - repos => 'opennebula', - required_packages => 'debian-keyring debian-archive-keyring', - pin => $apt_pin, - include_src => false, - require => Apt::Key['one_repo_key'], - } + apt::source { 'one-official': + location => "http://downloads.opennebula.org/repo/${apt_location}", + release => 'stable', + repos => 'opennebula', + required_packages => 'debian-keyring debian-archive-keyring', + pin => $apt_pin, + include_src => false, + require => Apt::Key['one_repo_key'], + } - apt::key { 'one_repo_key': - key => '85E16EBF', - key_source => 'http://downloads.opennebula.org/repo/Debian/repo.key', + apt::key { 'one_repo_key': + key => '85E16EBF', + key_source => 'http://downloads.opennebula.org/repo/Debian/repo.key', + } + } } - } - } default: { notice('We use opennebula from default OS repositories.') } diff --git a/spec/fixtures/hiera/test.yaml b/spec/fixtures/hiera/test.yaml index 1116bf10..96cd6093 100644 --- a/spec/fixtures/hiera/test.yaml +++ b/spec/fixtures/hiera/test.yaml @@ -2,7 +2,7 @@ one::head::ssh_pub_key: 'ssh pub key' one::head::ssh_priv_key: 'ssh-dsa priv key' -one::enable_opennebula_repo: true +one::enable_opennebula_repo: 'true' one::oned::db: oned one::oned::db_user: oned