- Update ODL to Beryllium SR2
2016-06-01 Release 3.6.1
- Minor bump due to Puppetforge issue
+2016-06-02 Release 3.7.0
+- Add param to configure ODL RPM repo
1. [Usage](#usage)
* [Karaf Features](#karaf-features)
* [Install Method](#install-method)
+ * [RPM Repo](#rpm-repo)
* [Ports](#ports)
* [Log Verbosity](#log-verbosity)
* [Enabling ODL OVSDB L3](#enabling-odl-ovsdb-l3)
}
```
+### RPM Repo
+
+The `rpm_repo` param can be used to configure which RPM repository
+OpenDaylight is installed from.
+
+```puppet
+class { 'opendaylight':
+ rpm_repo => 'opendaylight-40-release',
+}
+```
+
+The naming convention follows the naming convention of the CentOS Community
+Build System, which is where upstream ODL hosts its RPMs. The
+`opendaylight-40-release` example above would install OpenDaylight Beryllium
+4.0.0 from the [nfv7-opendaylight-40-release][19] repo. Repo names ending in
+`-release` will always contain well-tested, officially released versions of
+OpenDaylight. Repos ending in `-testing` contain frequent, but unstable and
+unofficial, releases. The ODL version given in repo names shows which major
+and minor version it is pinned to. The `opendaylight-40-release` repo will
+always provide OpenDaylight Beryllium 4.0, whereas `opendaylight-4-release`
+will provide the latest release with major version 4 (which could include
+Service Releases, like SR2 4.2).
+
+For a full list of OpenDaylight releases and their CBS repos, see the
+[OpenDaylight Deployment wiki][20].
+
+This is only read when `install_method` is `rpm`.
+
### Ports
To change the port on which OpenDaylight's northbound listens for REST API
[16]: https://github.com/dfarrell07/puppet-opendaylight/releases
[17]: https://github.com/dfarrell07/puppet-opendaylight/commits/master
[18]: http://cbs.centos.org/repos/nfv7-opendaylight-42-release/x86_64/os/Packages/
+[19]: http://cbs.centos.org/repos/nfv7-opendaylight-40-release/x86_64/os/Packages/ OpenDaylight Beryllium CentOS CBS repo
+[20]: https://wiki.opendaylight.org/view/Deployment#RPM OpenDaylight RPMs and their repos
:metadata,
]
-desc "Run Beaker tests against CentOS 7 node."
-task :centos do
- sh "RS_SET=centos-7 INSTALL_METHOD=rpm bundle exec rake beaker"
+desc "Run Beaker tests against CentOS 7 with latest Beryllium RPM"
+task :centos_odl4testing do
+ sh "RS_SET=centos-7 INSTALL_METHOD=rpm RPM_REPO='opendaylight-4-testing' bundle exec rake beaker"
+end
+
+desc "Run Beaker tests against CentOS 7 with Beryllium SR2 4.2."
+task :centos_odl42 do
+ sh "RS_SET=centos-7 INSTALL_METHOD=rpm RPM_REPO='opendaylight-42-release' bundle exec rake beaker"
+end
+
+desc "Run Beaker tests against CentOS 7 with Beryllium 4.0."
+task :centos_odl40 do
+ sh "RS_SET=centos-7 INSTALL_METHOD=rpm RPM_REPO='opendaylight-40-release' bundle exec rake beaker"
end
desc "Run Beaker tests against CentOS 7 using tarball install."
# the actually-functional systemd-container installed on centos:7
# https://github.com/CentOS/sig-cloud-instance-build/commit/3bf1e7bbf14deaa8c047c1dfbead6d0e8d0665f2
desc "Run Beaker tests against CentOS 7 Docker node."
-task :centos_7_docker do
+task :centos_docker do
sh "RS_SET=centos-7-docker INSTALL_METHOD=rpm bundle exec rake beaker"
end
# IP for ODL northbound REST interface to bind to.
# [*install_method *]
# How to install OpenDaylight. Current options are "rpm" and "tarball", default is RPM.
+# [*rpm_repo*]
+# OpenDaylight CentOS CBS repo to install RPM from (opendaylight-4-testing, opendaylight-40-release, ...).
# [*tarball_url*]
# If installing from a tarball, use this one. Defaults to latest ODL.
# [*unitfile_url*]
$odl_rest_port = $::opendaylight::params::odl_rest_port,
$odl_bind_ip = $::opendaylight::params::odl_bind_ip,
$install_method = $::opendaylight::params::install_method,
+ $rpm_repo = $::opendaylight::params::rpm_repo,
$tarball_url = $::opendaylight::params::tarball_url,
$unitfile_url = $::opendaylight::params::unitfile_url,
$enable_l3 = $::opendaylight::params::enable_l3,
#
class opendaylight::install {
if $opendaylight::install_method == 'rpm' {
- # Choose Yum URL based on OS (CentOS vs Fedora)
- # NB: Currently using the CentOS CBS for both Fedora and CentOS
- $base_url = $::operatingsystem ? {
- 'CentOS' => 'http://cbs.centos.org/repos/nfv7-opendaylight-42-release/$basearch/os/',
- 'Fedora' => 'http://cbs.centos.org/repos/nfv7-opendaylight-42-release/$basearch/os/',
- }
-
# Add OpenDaylight's Yum repository
- yumrepo { 'opendaylight-42-release':
+ yumrepo { $opendaylight::rpm_repo:
# 'ensure' isn't supported with Puppet <3.5
# 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 => $base_url,
- descr => 'CentOS CBS OpenDaylight Berillium testing repository',
+ baseurl => "http://cbs.centos.org/repos/nfv7-${opendaylight::rpm_repo}/\$basearch/os/",
+ descr => 'OpenDaylight SDN Controller',
enabled => 1,
# NB: RPM signing is an active TODO, but is not done. We will enable
# this gpgcheck once the RPM supports it.
# Install the OpenDaylight RPM
package { 'opendaylight':
ensure => present,
- require => Yumrepo['opendaylight-42-release'],
+ require => Yumrepo[$opendaylight::rpm_repo],
}
->
# Configure the systemd file to force ipv4 binds (instead of ipv6)
$odl_rest_port = '8080'
$odl_bind_ip = '0.0.0.0'
$install_method = 'rpm'
+ $rpm_repo = 'opendaylight-42-release'
$tarball_url = 'https://nexus.opendaylight.org/content/repositories/opendaylight.release/org/opendaylight/integration/distribution-karaf/0.4.2-Beryllium-SR2/distribution-karaf-0.4.2-Beryllium-SR2.tar.gz'
$unitfile_url = 'https://github.com/dfarrell07/opendaylight-systemd/archive/master/opendaylight-unitfile.tar.gz'
$odl_rest_port = '8080'
{
"name": "dfarrell07-opendaylight",
- "version": "3.6.1",
+ "version": "3.7.0",
"author": "Daniel Farrell",
"summary": "Puppet module that installs and configures the OpenDaylight SDN controller",
"license": "BSD-2-Clause",
operatingsystemmajrelease = '7'
# All tests for RPM install method
- context 'RPM' do
- let(:facts) {{
- :osfamily => osfamily,
- :operatingsystem => operatingsystem,
- :operatingsystemmajrelease => operatingsystemmajrelease,
- }}
+ describe 'RPM' do
+ context 'installing default RPM' do
+ let(:facts) {{
+ :osfamily => osfamily,
+ :operatingsystem => operatingsystem,
+ :operatingsystemmajrelease => operatingsystemmajrelease,
+ }}
- let(:params) {{
- :install_method => 'rpm',
- }}
+ let(:params) {{
+ :install_method => 'rpm',
+ }}
- # Run shared tests applicable to all supported OSs
- # Note that this function is defined in spec_helper
- generic_tests
+ # Run shared tests applicable to all supported OSs
+ # Note that this function is defined in spec_helper
+ generic_tests
- # Run test that specialize in checking RPM-based installs
- # Note that this function is defined in spec_helper
- rpm_install_tests
+ # Run test that specialize in checking RPM-based installs
+ # Note that this function is defined in spec_helper
+ rpm_install_tests
+ end
+
+ context 'installing Beryllium RPM' do
+ rpm_repo = 'opendaylight-40-release'
+ let(:facts) {{
+ :osfamily => osfamily,
+ :operatingsystem => operatingsystem,
+ :operatingsystemmajrelease => operatingsystemmajrelease,
+ }}
+
+ let(:params) {{
+ :install_method => 'rpm',
+ :rpm_repo => rpm_repo,
+ }}
+
+ # Run shared tests applicable to all supported OSs
+ # Note that this function is defined in spec_helper
+ generic_tests
+
+ # Run test that specialize in checking RPM-based installs
+ # Note that this function is defined in spec_helper
+ rpm_install_tests(rpm_repo: rpm_repo)
+ end
end
# All tests for tarball install method
tarball_url = options.fetch(:tarball_url, 'https://nexus.opendaylight.org/content/repositories/opendaylight.release/org/opendaylight/integration/distribution-karaf/0.4.2-Beryllium-SR2/distribution-karaf-0.4.2-Beryllium-SR2.tar.gz')
unitfile_url = options.fetch(:unitfile_url, 'https://github.com/dfarrell07/opendaylight-systemd/archive/master/opendaylight-unitfile.tar.gz')
osfamily = options.fetch(:osfamily, 'RedHat')
+ rpm_repo = options.fetch(:rpm_repo, 'opendaylight-42-release')
# Confirm presence of tarball-related resources
it { should contain_archive('opendaylight') }
end
# Verify that there are no unexpected resources from RPM-type installs
- it { should_not contain_yumrepo('opendaylight-42-release') }
+ it { should_not contain_yumrepo(rpm_repo) }
it { should_not contain_package('opendaylight') }
end
def rpm_install_tests(options = {})
# Extract params
- # Choose Yum URL based on OS (CentOS vs Fedora)
- # NB: Currently using the CentOS CBS for both Fedora and CentOS
- operatingsystem = options.fetch(:operatingsystem, 'CentOS')
- case operatingsystem
- when 'CentOS'
- yum_repo = 'http://cbs.centos.org/repos/nfv7-opendaylight-42-release/$basearch/os/'
- when 'Fedora'
- yum_repo = 'http://cbs.centos.org/repos/nfv7-opendaylight-42-release/$basearch/os/'
- else
- fail("Unknown operatingsystem: #{operatingsystem}")
- end
+ rpm_repo = options.fetch(:rpm_repo, 'opendaylight-42-release')
# Default to CentOS 7 Yum repo URL
# Confirm presence of RPM-related resources
- it { should contain_yumrepo('opendaylight-42-release') }
+ it { should contain_yumrepo(rpm_repo) }
it { should contain_package('opendaylight') }
# Confirm relationships between RPM-related resources
- it { should contain_package('opendaylight').that_requires('Yumrepo[opendaylight-42-release]') }
- it { should contain_yumrepo('opendaylight-42-release').that_comes_before('Package[opendaylight]') }
+ it { should contain_package('opendaylight').that_requires("Yumrepo[#{rpm_repo}]") }
+ it { should contain_yumrepo(rpm_repo).that_comes_before('Package[opendaylight]') }
# Confirm properties of RPM-related resources
# NB: These hashes don't work with Ruby 1.8.7, but we
# don't support 1.8.7 so that's okay. See issue #36.
it {
- should contain_yumrepo('opendaylight-42-release').with(
+ should contain_yumrepo(rpm_repo).with(
'enabled' => '1',
'gpgcheck' => '0',
- 'descr' => 'CentOS CBS OpenDaylight Berillium testing repository',
- 'baseurl' => yum_repo,
+ 'descr' => 'OpenDaylight SDN Controller',
+ 'baseurl' => "http://cbs.centos.org/repos/nfv7-#{rpm_repo}/$basearch/os/",
)
}
it {
def unsupported_os_tests(options = {})
# Extract params
expected_msg = options.fetch(:expected_msg)
+ rpm_repo = options.fetch(:rpm_repo, 'opendaylight-42-release')
# Confirm that classes fail on unsupported OSs
it { expect { should contain_class('opendaylight') }.to raise_error(Puppet::Error, /#{expected_msg}/) }
it { expect { should contain_class('opendaylight::service') }.to raise_error(Puppet::Error, /#{expected_msg}/) }
# Confirm that other resources fail on unsupported OSs
- it { expect { should contain_yumrepo('opendaylight-42-release') }.to raise_error(Puppet::Error, /#{expected_msg}/) }
+ it { expect { should contain_yumrepo(rpm_repo) }.to raise_error(Puppet::Error, /#{expected_msg}/) }
it { expect { should contain_package('opendaylight') }.to raise_error(Puppet::Error, /#{expected_msg}/) }
it { expect { should contain_service('opendaylight') }.to raise_error(Puppet::Error, /#{expected_msg}/) }
it { expect { should contain_file('org.apache.karaf.features.cfg') }.to raise_error(Puppet::Error, /#{expected_msg}/) }
# http://serverspec.org/resource_types.html
def install_odl(options = {})
+ # Install params are passed via environment var, set in Rakefile
+ # Changing the installed version of ODL via `puppet apply` is not supported
+ # by puppet-odl, so it's not possible to vary these params in the same
+ # Beaker test run. Do a different run passing different env vars.
+ install_method = ENV['INSTALL_METHOD']
+ rpm_repo = ENV['RPM_REPO']
+
# NB: These param defaults should match the ones used by the opendaylight
# class, which are defined in opendaylight::params
# TODO: Remove this possible source of bugs^^
# Extract params if given, defaulting to odl class defaults if not
- # Default install method is passed via environment var, set in Rakefile
- install_method = options.fetch(:install_method, ENV['INSTALL_METHOD'])
extra_features = options.fetch(:extra_features, [])
default_features = options.fetch(:default_features,
['config', 'standard', 'region', 'package', 'kar', 'ssh', 'management'])
pp = <<-EOS
class { 'opendaylight':
install_method => #{install_method},
+ rpm_repo => #{rpm_repo},
default_features => #{default_features},
extra_features => #{extra_features},
odl_rest_port=> #{odl_rest_port},
# Shared function that handles validations specific to RPM-type installs
def rpm_validations()
- describe yumrepo('opendaylight-42-release') do
+ rpm_repo = ENV['RPM_REPO']
+
+ describe yumrepo(rpm_repo) do
it { should exist }
it { should be_enabled }
end
# Shared function that handles validations specific to tarball-type installs
def tarball_validations()
+ rpm_repo = ENV['RPM_REPO']
+
describe package('opendaylight') do
it { should_not be_installed }
end
# Repo checks break (not fail) when yum doesn't make sense (Ubuntu)
if ['centos-7', 'fedora-22', 'fedora-23', 'fedora-23-docker'].include? ENV['RS_SET']
- describe yumrepo('opendaylight-42-release') do
+ describe yumrepo(rpm_repo) do
it { should_not exist }
it { should_not be_enabled }
end