Skip to content

Commit 47a6cf3

Browse files
committed
Merge pull request #127 from tuxmea/repo_toggle
refacter repo toggle
2 parents fb6454d + 75a76c1 commit 47a6cf3

3 files changed

Lines changed: 30 additions & 30 deletions

File tree

manifests/params.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
# can be set to the user field that is in the group group_field
4646
$oned_ldap_user_group_field = hiera('one::oned::ldap_user_group_field','undef'),
4747
# should we enable opennebula repos?
48-
$one_repo_enable = hiera('one::enable_opennebula_repo', true ),
48+
$one_repo_enable = hiera('one::enable_opennebula_repo', 'true' ),
4949

5050
$backup_script_path = hiera ('one::oned::backup::script_path', '/var/lib/one/bin/one_db_backup.sh'),
5151
$ssh_priv_key_param = hiera('one::head::ssh_priv_key',undef),

manifests/prerequisites.pp

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
class one::prerequisites {
2222
case $::osfamily {
2323
'RedHat': {
24-
if ( $one::params::one_repo_enable == true ) {
24+
if ( $one::params::one_repo_enable == 'true' ) {
2525
yumrepo { 'opennebula':
2626
baseurl => 'http://downloads.opennebula.org/repo/4.10/CentOS/6/x86_64/',
2727
descr => 'OpenNebula',
@@ -31,36 +31,36 @@
3131
}
3232
}
3333
'Debian' : {
34-
if ($one::params::one_repo_enable == true) {
35-
include ::apt
36-
case $::operatingsystem {
37-
'Debian': {
38-
$apt_location="4.10/Debian/${::lsbmajdistrelease}"
39-
$apt_pin='-10'
40-
}
41-
'Ubuntu': {
42-
$apt_location="4.10/Ubuntu/${::lsbdistrelease}"
43-
$apt_pin='500'
44-
}
45-
default: { fail("Unrecognized operating system ${::operatingsystem}") }
46-
}
34+
if ($one::params::one_repo_enable == 'true') {
35+
include ::apt
36+
case $::operatingsystem {
37+
'Debian': {
38+
$apt_location="4.10/Debian/${::lsbmajdistrelease}"
39+
$apt_pin='-10'
40+
}
41+
'Ubuntu': {
42+
$apt_location="4.10/Ubuntu/${::lsbdistrelease}"
43+
$apt_pin='500'
44+
}
45+
default: { fail("Unrecognized operating system ${::operatingsystem}") }
46+
}
4747

48-
apt::source { 'one-official':
49-
location => "http://downloads.opennebula.org/repo/${apt_location}",
50-
release => 'stable',
51-
repos => 'opennebula',
52-
required_packages => 'debian-keyring debian-archive-keyring',
53-
pin => $apt_pin,
54-
include_src => false,
55-
require => Apt::Key['one_repo_key'],
56-
}
48+
apt::source { 'one-official':
49+
location => "http://downloads.opennebula.org/repo/${apt_location}",
50+
release => 'stable',
51+
repos => 'opennebula',
52+
required_packages => 'debian-keyring debian-archive-keyring',
53+
pin => $apt_pin,
54+
include_src => false,
55+
require => Apt::Key['one_repo_key'],
56+
}
5757

58-
apt::key { 'one_repo_key':
59-
key => '85E16EBF',
60-
key_source => 'http://downloads.opennebula.org/repo/Debian/repo.key',
58+
apt::key { 'one_repo_key':
59+
key => '85E16EBF',
60+
key_source => 'http://downloads.opennebula.org/repo/Debian/repo.key',
61+
}
62+
}
6163
}
62-
}
63-
}
6464
default: {
6565
notice('We use opennebula from default OS repositories.')
6666
}

spec/fixtures/hiera/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
one::head::ssh_pub_key: 'ssh pub key'
33
one::head::ssh_priv_key: 'ssh-dsa priv key'
44

5-
one::enable_opennebula_repo: true
5+
one::enable_opennebula_repo: 'true'
66

77
one::oned::db: oned
88
one::oned::db_user: oned

0 commit comments

Comments
 (0)