Skip to content
Open
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
16 changes: 16 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,22 @@ For a full list of OpenDaylight releases and their CBS repos, see the
This is only read for RedHat based operating systems. For Debian based OSs,
this values is `none`.

It's also possible to use the baseurl parameter to have a custom repository.

```puppet
class { 'opendaylight':
rpm_repo => 'opendaylight-5-testing',
baseurl => 'http://cbs.centos.org/repos/nfv7-opendaylight-5-testing/$basearch/os/'
}
```
To disable the repository (For example when a repository for OpenDaylight already exists) use:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"For" should not be capitalized


```puppet
class { 'opendaylight':
manage_repositories => false,
}
```

### Deb Repo

The `deb_repo` param can be used to configure which Deb repository
Expand Down
6 changes: 6 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
# [*rpm_repo*]
# OpenDaylight CentOS CBS repo to install RPM from (opendaylight-4-testing,
# opendaylight-40-release, ...).
# [*baseurl*]
# The Yum repository URL that holds the OpenDaylight RPM
# [*rpm_repo_gpgcheck*]
# Enable or disable GPG check for the RPM repository
# [*deb_repo*]
# OpenDaylight Launchpad PPA repo to install .deb from (ppa:odl-team/boron,
# ppa:odl-team/carbon, ...).
Expand Down Expand Up @@ -44,6 +48,8 @@
$odl_rest_port = $::opendaylight::params::odl_rest_port,
$odl_bind_ip = $::opendaylight::params::odl_bind_ip,
$rpm_repo = $::opendaylight::params::rpm_repo,
$baseurl = "http://cbs.centos.org/repos/nfv7-${rpm_repo}/\$basearch/os/",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this will work. rpm_repo is always reading the one inherited from params because the rpm_repo you are overriding in this class hasn't been parsed yet. So it is never using the value you pass to rpm_repo. One option is to just make baseurl a separate param that is inherited, like this:
$baseurl = $::opendaylight::params::baseurl,

params.pp:
$baseurl = "http://cbs.centos.org/repos/nfv7-${rpm_repo}/\$basearch/os/"

Then the user is responsible to override baseurl as well as rpm_repo if they want to change how the repo is created.

$rpm_repo_gpgcheck = $::opendaylight::params::rpm_repo_gpgcheck,
$deb_repo = $::opendaylight::params::deb_repo,
$log_levels = $::opendaylight::params::log_levels,
$enable_ha = $::opendaylight::params::enable_ha,
Expand Down
1 change: 1 addition & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
$odl_bind_ip = '0.0.0.0'
$rpm_repo = 'opendaylight-5-testing'
$deb_repo = 'ppa:odl-team/boron'
$rpm_repo_gpgcheck = 0
$log_levels = {}
$enable_ha = false
$ha_node_ips = []
Expand Down
5 changes: 3 additions & 2 deletions manifests/repos.pp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
$deb_repo = $::opendaylight::deb_repo,
$rpm_repo = $::opendaylight::rpm_repo,
$rpm_repo_enabled = 1,
$rpm_repo_gpgcheck = 0,
$rpm_repo_gpgcheck = $::opendaylight::rpm_repo_gpgcheck,
$baseurl = $::opendaylight::baseurl,
) inherits ::opendaylight {
if $::osfamily == 'RedHat' {
# Add OpenDaylight's Yum repository
Expand All @@ -34,7 +35,7 @@
# Seems to default to present, but docs don't say
# https://docs.puppetlabs.com/references/3.4.0/type.html#yumrepo
# https://docs.puppetlabs.com/references/3.5.0/type.html#yumrepo
baseurl => "http://cbs.centos.org/repos/nfv7-${rpm_repo}/\$basearch/os/",
baseurl => $baseurl,
descr => 'OpenDaylight SDN Controller',
enabled => $rpm_repo_enabled,
# NB: RPM signing is an active TODO, but is not done. We will enable
Expand Down
6 changes: 4 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ def rpm_install_tests(options = {})
# Extract params
rpm_repo = options.fetch(:rpm_repo, 'opendaylight-5-testing')
java_opts = options.fetch(:java_opts, '-Djava.net.preferIPv4Stack=true')
baseurl = options.fetch(:baseurl, "http://cbs.centos.org/repos/nfv7-#{rpm_repo}/$basearch/os/")
enable_repo = options.fetch(:enable_repo, '1')

# Default to CentOS 7 Yum repo URL

Expand All @@ -233,10 +235,10 @@ def rpm_install_tests(options = {})
# don't support 1.8.7 so that's okay. See issue #36.
it {
should contain_yumrepo(rpm_repo).with(
'enabled' => '1',
'enabled' => "#{enable_repo}",
'gpgcheck' => '0',
'descr' => 'OpenDaylight SDN Controller',
'baseurl' => "http://cbs.centos.org/repos/nfv7-#{rpm_repo}/$basearch/os/",
'baseurl' => "#{baseurl}",
)
}
it {
Expand Down