Skip to content

Commit

Permalink
Merge pull request #127 from tuxmea/repo_toggle
Browse files Browse the repository at this point in the history
refacter repo toggle
  • Loading branch information
nmesstorff committed Feb 7, 2015
2 parents fb6454d + 75a76c1 commit 47a6cf3
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
56 changes: 28 additions & 28 deletions manifests/prerequisites.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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.')
}
Expand Down
2 changes: 1 addition & 1 deletion spec/fixtures/hiera/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 47a6cf3

Please sign in to comment.