dfarrell07 / ansible-opendaylight Goto Github PK
View Code? Open in Web Editor NEWMoved: https://git.opendaylight.org/gerrit/gitweb?p=integration/packaging/ansible-opendaylight.git;a=tree
Moved: https://git.opendaylight.org/gerrit/gitweb?p=integration/packaging/ansible-opendaylight.git;a=tree
Update information about #opendaylight-integration IRC channel.
Once we do #5, we'll need to add the logic for opening that port (and maybe others) via any firewall running on the system.
Docker containers can't currently coexist with systemd (it can't be installed in them, they replace it with fakesystemd), so being about to support running without systemd is a requirement of provisioning them. This Ansible role currently uses systemd for at least one task (info below).
The Packer configuration in the upstream ODL Integration is currently hitting an issue because of this. While building Docker images (using under-dev, uncommitted scratch logic), everything works up until a firewalld check that requires systemd.
docker: PLAY [localhost] **************************************************************
docker:
docker: GATHERING FACTS ***************************************************************
docker: ok: [localhost]
docker:
docker: TASK: [dfarrell07.opendaylight | Add ODL yum repo] ****************************
docker: changed: [localhost]
docker:
docker: TASK: [dfarrell07.opendaylight | Install ODL via RPM repo] ********************
docker: changed: [localhost]
docker:
docker: TASK: [dfarrell07.opendaylight | Install ODL via RPM path] ********************
docker: skipping: [localhost]
docker:
docker: TASK: [dfarrell07.opendaylight | Configure ODL Karaf features] ****************
docker: changed: [localhost]
docker:
docker: TASK: [dfarrell07.opendaylight | Configure ODL NB REST port] ******************
docker: changed: [localhost]
docker:
docker: TASK: [dfarrell07.opendaylight | Check if FirewallD service is running] *******
docker: fatal: [localhost] => error while evaluating conditional: firewalld_status.stdout not in ['unknown', 'active']
docker:
docker: FATAL: all hosts have already failed -- aborting
docker:
docker: PLAY RECAP ********************************************************************
docker: to retry, use: --limit @/root/install_odl.retry
docker:
docker: localhost : ok=5 changed=4 unreachable=1 failed=0
docker:
==> docker: Killing the container: abb4c1dd9fde122569933f1d9f7db089bec6f1e8626c9e70d2c9b6d0046350ad
Build 'docker' errored: Error executing Ansible: Non-zero exit status: 3
On distros that have moved to dnf as the default package manager over yum (like Fedora 22, Fedora 23), the role fails with a yum import error.
Traceback (most recent call last):
File "/home/vagrant/.ansible/tmp/ansible-tmp-1453913472.43-6655968565982/yum", line 27, in <module>
import yum
ImportError: No module named yum
The right way to fix this is to use the package
Ansible role, which supports both yum and dnf. That came out in Ansible 2.0, which was very recently released but hasn't yet been packaged and distributed as an RPM. The could be fixed by moving to the dnf
Ansible module, but that would break yum distros like CentOS 7. Could add some conditional to the tasks, but that's hack.
For now we'll target CentOS 7 over F22/F23 and move to the package module once it's out.
As of 0927d39, using the vagrant-opendaylight project to test a Vagrant box provisioned with this role.
Starting with a fresh VM and default Ansible role vars:
[~/vagrant-opendaylight]$ vagrant destroy -f cent7_ansible
<snip>
[~/vagrant-opendaylight]$ ansible-galaxy install -r requirements.yml --force
- executing: git clone https://github.com/dfarrell07/ansible-opendaylight opendaylight
- executing: git archive --prefix=opendaylight/ --output=/tmp/tmpRSX32Z.tar HEAD
- extracting opendaylight to provisioning/roles/opendaylight
- opendaylight was installed successfully
[~/vagrant-opendaylight]$ vagrant up cent7_ansible
Bringing machine 'cent7_ansible' up with 'virtualbox' provider...
<snip>
PLAY [all] ********************************************************************
GATHERING FACTS ***************************************************************
ok: [cent7_ansible]
TASK: [opendaylight | Add ODL yum repo] ***************************************
changed: [cent7_ansible]
TASK: [opendaylight | Install ODL RPM] ****************************************
changed: [cent7_ansible]
TASK: [opendaylight | Configure ODL Karaf features] ***************************
changed: [cent7_ansible]
TASK: [opendaylight | Start ODL systemd service] ******************************
changed: [cent7_ansible]
NOTIFIED: [opendaylight | Restart ODL] ****************************************
changed: [cent7_ansible]
PLAY RECAP ********************************************************************
cent7_ansible : ok=6 changed=5 unreachable=0 failed=0
Connecting to the new box and poking around, I see the expected Karaf feature config:
[~/vagrant-opendaylight]$ vagrant ssh cent7_ansible
Last login: Fri May 15 21:20:41 2015 from 10.0.2.2
[vagrant@localhost ~]$ cat /opt/opendaylight/etc/org.apache.karaf.features.cfg | grep featuresBoot=
featuresBoot=config,standard,region,package,kar,ssh,management
Also, for the sake of future testing, note that odl-ovsdb-openstack
isn't installed (feature chosen arbitrarily, just needs to be a non-default one to show this behavior):
[vagrant@localhost ~]$ cd /vagrant/scripts/
[vagrant@localhost scripts]$ ./connect.sh
<snip>
________ ________ .__ .__ .__ __
\_____ \ ______ ____ ____ \______ \ _____ ___.__.| | |__| ____ | |___/ |_
/ | \\____ \_/ __ \ / \ | | \\__ \< | || | | |/ ___\| | \ __\
/ | \ |_> > ___/| | \| ` \/ __ \\___ || |_| / /_/ > Y \ |
\_______ / __/ \___ >___| /_______ (____ / ____||____/__\___ /|___| /__|
\/|__| \/ \/ \/ \/\/ /_____/ \/
Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown OpenDaylight.
opendaylight-user@root>feature:list | grep openstack
odl-ovsdb-openstack | 1.0.3-Helium-SR3 | | ovsdb-1.0.3-Helium-SR3 | OpenDaylight :: OVSDB :: OpenStack Network Virtual
Manually editing the extra_features
value of the role in the vagrant-odl project to add `odl-ovsdb-openstack':
[~/vagrant-opendaylight]$ cat provisioning/roles/opendaylight/vars/main.yml | grep extra_featur
es:
extra_features: ['odl-ovsdb-openstack']
Then re-provisioning:
[~/vagrant-opendaylight]$ vagrant provision cent7_ansible
<snip>
PLAY [all] ********************************************************************
GATHERING FACTS ***************************************************************
ok: [cent7_ansible]
TASK: [opendaylight | Add ODL yum repo] ***************************************
ok: [cent7_ansible]
TASK: [opendaylight | Install ODL RPM] ****************************************
ok: [cent7_ansible]
TASK: [opendaylight | Configure ODL Karaf features] ***************************
changed: [cent7_ansible]
TASK: [opendaylight | Start ODL systemd service] ******************************
ok: [cent7_ansible]
NOTIFIED: [opendaylight | Restart ODL] ****************************************
changed: [cent7_ansible]
PLAY RECAP ********************************************************************
cent7_ansible : ok=6 changed=2 unreachable=0 failed=0
I see the correct Karaf feature config updates:
[~/vagrant-opendaylight]$ vagrant ssh cent7_ansible
Last login: Fri May 15 21:46:04 2015 from 10.0.2.2
[vagrant@localhost ~]$ cat /opt/opendaylight/etc/org.apache.karaf.features.cfg | grep featuresBoot=
featuresBoot=config,standard,region,package,kar,ssh,management,odl-ovsdb-openstack
And the non-standard feature is installed, as expected:
[vagrant@localhost ~]$ cd /vagrant/scripts/
[vagrant@localhost scripts]$ ./connect.sh
Will repeatedly attempt connecting to Karaf shell until it's ready
Warning: Permanently added '[localhost]:8101' (DSA) to the list of known hosts.
Authenticated with partial success.
________ ________ .__ .__ .__ __
\_____ \ ______ ____ ____ \______ \ _____ ___.__.| | |__| ____ | |___/ |_
/ | \\____ \_/ __ \ / \ | | \\__ \< | || | | |/ ___\| | \ __\
/ | \ |_> > ___/| | \| ` \/ __ \\___ || |_| / /_/ > Y \ |
\_______ / __/ \___ >___| /_______ (____ / ____||____/__\___ /|___| /__|
\/|__| \/ \/ \/ \/\/ /_____/ \/
Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown OpenDaylight.
opendaylight-user@root>feature:list | grep openstack
odl-ovsdb-openstack | 1.0.3-Helium-SR3 | x | ovsdb-1.0.3-Helium-SR3 | OpenDaylight :: OVSDB :: OpenStack Network Virtual
Everything up to this point works as expected.
Now, removing the extra_feature
from the vars in vagrant-odl:
[~/vagrant-opendaylight]$ cat provisioning/roles/opendaylight/vars/main.yml | grep extra_features:
extra_features: []
And re-provisioning:
[~/vagrant-opendaylight]$ vagrant provision cent7_ansible
<snip>
PLAY [all] ********************************************************************
GATHERING FACTS ***************************************************************
ok: [cent7_ansible]
TASK: [opendaylight | Add ODL yum repo] ***************************************
ok: [cent7_ansible]
TASK: [opendaylight | Install ODL RPM] ****************************************
ok: [cent7_ansible]
TASK: [opendaylight | Configure ODL Karaf features] ***************************
changed: [cent7_ansible]
TASK: [opendaylight | Start ODL systemd service] ******************************
ok: [cent7_ansible]
NOTIFIED: [opendaylight | Restart ODL] ****************************************
changed: [cent7_ansible]
PLAY RECAP ********************************************************************
cent7_ansible : ok=6 changed=2 unreachable=0 failed=0
I see the Karaf features updated as expected:
[~/vagrant-opendaylight]$ vagrant ssh cent7_ansible
Last login: Fri May 15 21:52:48 2015 from 10.0.2.2
[vagrant@localhost ~]$ cat /opt/opendaylight/etc/org.apache.karaf.features.cfg | grep featuresBoot=
featuresBoot=config,standard,region,package,kar,ssh,management
But, the non-standard feature is still installed:
[vagrant@localhost ~]$ cd /vagrant/scripts/
[vagrant@localhost scripts]$ ./connect.sh
Will repeatedly attempt connecting to Karaf shell until it's ready
Warning: Permanently added '[localhost]:8101' (DSA) to the list of known hosts.
Authenticated with partial success.
________ ________ .__ .__ .__ __
\_____ \ ______ ____ ____ \______ \ _____ ___.__.| | |__| ____ | |___/ |_
/ | \\____ \_/ __ \ / \ | | \\__ \< | || | | |/ ___\| | \ __\
/ | \ |_> > ___/| | \| ` \/ __ \\___ || |_| / /_/ > Y \ |
\_______ / __/ \___ >___| /_______ (____ / ____||____/__\___ /|___| /__|
\/|__| \/ \/ \/ \/\/ /_____/ \/
Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown OpenDaylight.
opendaylight-user@root>feature:list | grep openstack
odl-ovsdb-openstack | 1.0.3-Helium-SR3 | x | ovsdb-1.0.3-Helium-SR3 | OpenDaylight :: OVSDB :: OpenStack Network Virtual
That's unexpected. I hoped that removing features from the Karaf default-install config file and restarting ODL would result in the features not being installed after the restart. That doesn't seem to be the case. This is (very likely) an unexpected ODL behavior (not a bug necessarily) that's undesirable for this situation.
This is still a very new project, so it's okay that the docs aren't perfect, but it'd be nice to to have a README that's more than a simple stub.
Need to document the new ability to configure ODL's NB REST API port in the README.
Need to use a template to configure ODL's Karaf feature config file, to support installing a set of Karaf features at ODL start.
As described in #7, Karaf supports starting from a clean state via bin/start clean
or manually removing the data/
directory. This causes exactly the set of Karaf features (and their deps) described in the featuresBoot
list to be installed, no extra. A normal restart of ODL will leave the same features installed (cached in data/
), even if they have been removed from the featuresBoot
list by Ansible.
When we do Karaf feature config changes, we need to do a clean start of ODL to remove any potentially old features.
To provide a better experience for consumers of the ODL Ansible role, we need to support user-defined ODL version installs from ansible-opendaylight latest code (vs tags for versions with no backporting of features/fixes).
A number of use-cases (clean feature install/uninstall, installing invividual bundles) seem to require the ability to interact with the Karaf shell. I'd like to add an Ansible task for abstracting that logic and supporting those use-cases.
I use a custom set of labels for GitHub Issues. Need to configure them for this repo. See the Puppet mod for an example.
This will need to be called after the Karaf features config task (#1), to restart ODL and get any new features.
Hi Daniel,
I want to install Jolokia-OSGi bundle in ODL, of course I can input "bundle:install -s mvn:org.jolokia/jolokia-osgi/1.1.4 " in the Karaf console, but I hope this can be executed automatically, I google and get 2 solutions, one is add "mvn:org.jolokia/jolokia-osgi/1.1.4/xml/features" to item featuresRepositories in org.apache.karaf.features.cfg file, and another one is add xml, I create jolokia-osgi-1.1.4-features.xml file under the path opendaylight-0.2.2/system/org/jolokia/jolokia-osgi/1.1.4, which content is as below
I restart karaf, and bundle:list still doesn't show jolokia info. could you help me about this issue?
thanks in advance.
Should track versions using proper semantic versioning. Not sure what the Ansible best practices are for version (Puppet mods use use a CHANGELOG file, for example).
Hi Daniel, I am from OPNFV compass team. We are going to use this ansible-opendaylight in our compass installer which supports both centos and ubuntu os. It seems that currently only rpm package of ODL release is supported. So, will you also support deb package of ODL release?
Upstream ODL is now distributing the ODL Lithium RPM via the CentOS Community Build System. Need to update the ODL repo to point at this new location and update everything else for Lithium (templates, default ports, etc).
Need to add docs that provide a number of examples of applying this Ansible role and the expected results.
As mentioned in #10, there are use-cases for configuring the list of feature repos Karaf uses to search for features. The featuresRepositories
list in org.apache.karaf.features.cfg
needs to be configured via a template (much like featuresBoot
in the same config file).
#
# Comma separated list of features repositories to register by default
#
featuresRepositories = mvn:org.apache.karaf.features/standard/3.0.1/xml/features,mvn:org.apache.karaf.features/enterprise/3.0.1/xml/features,mvn:org.ops4j.pax.web/pax-web-features/3.1.0/xml/features,mvn:org.apache.karaf.features/spring/3.0.1/xml/features,mvn:org.opendaylight.integration/features-integration/0.2.3-Helium-SR3/xml/features
I came across this error building opendaylight 3.4.0 using virtualbox template and centos (see gist)
https://gist.github.com/mosieurlaurin/bcb6c0bba2581a9317cae2bce74db7e4
I've been building this using patchset 4 here:
https://git.opendaylight.org/gerrit/#/c/38120/
A long-term goal of ODL's deployment efforts has been to support standing up ODL clusters. The Puppet module would have needed a Puppet Master to reasonably handle a multi-machine deploymnet, which would be an undesirable complexity bump for our users. The drive to build an ODL Ansible role was largely spurred by the need to support clustering use-cases and Puppet's inadequacy for doing so.
This issue will track progress towards clustering in general. Additional ones will be raised as-needed for specific, more narrowly scoped, issues.
It's currently Li 3.0.0, which would break with the 3.3.0 feature repo default.
rpm_path: "http://cbs.centos.org/repos/nfv7-opendaylight-3-candidate/x86_64/os/Packages/opendaylight-3.0.0-2.el7.noarch.rpm"
default_feature_repos:
- 'mvn:org.apache.karaf.features/standard/3.0.3/xml/features'
- 'mvn:org.apache.karaf.features/enterprise/3.0.3/xml/features'
- 'mvn:org.ops4j.pax.web/pax-web-features/3.1.4/xml/features'
- 'mvn:org.apache.karaf.features/spring/3.0.3/xml/features'
- 'mvn:org.opendaylight.integration/features-integration-index/0.3.3-Lithium-SR3/xml/features'
Need docs on how to contribute to the project. See the Puppet mod's CONTRIBUTING.markdown file as a good example.
ODL's NB REST port (8080) conflicts with a number of other services, including OpenStack Swift. We need the ability to configure it via the relevant config file as a template.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.