dfarrell07 / ansible-opendaylight

Moved: https://git.opendaylight.org/gerrit/gitweb?p=integration/packaging/ansible-opendaylight.git;a=tree
9 stars 12 forks source link

How to put bundle install in this ansible #10

Closed chenshuai123 closed 9 years ago

chenshuai123 commented 9 years ago

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 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>

mvn:org.jolokia/jolokia-osgi/1.1.4/xml/features mvn:org.jolokia/jolokia-osgi/1.1.4

I restart karaf, and bundle:list still doesn't show jolokia info. could you help me about this issue? thanks in advance.

dfarrell07 commented 9 years ago

Hey @chenshuai123! Just wanted to send a quick ACK. This is a great, relevant feature request. Thank you for highlighting the need and raising an Issue. I'll take a look at this ASAP, initially to verify how bundles should be installed, then to add it to ODL's config management tools.

dfarrell07 commented 9 years ago

Example desired behavior via Karaf shell:

opendaylight-user@root>bundle:list | grep Jolo
opendaylight-user@root>feature:install http
opendaylight-user@root>bundle:install -s mvn:org.jolokia/jolokia-osgi/1.1.5
Bundle ID: 96
opendaylight-user@root>bundle:list | grep Jolo
96 | Active   |  80 | 1.1.5                  | Jolokia Agent
opendaylight-user@root>bundle:uninstall Jolokia
opendaylight-user@root>bundle:list | grep Jolo
opendaylight-user@root>

The two config changes you described could be used to point Karaf at new feature descriptions, each consisting of a set of bundles and/or nested features. However, they will not actually install the feature (although you could use our existing Karaf feature install logic to do so after the repo is added), and I don't think they can be used to directly install individual bundles (not grouped into features).

I'll ask around about other ways to install bundles that aren't grouped into features, but as far as I know bundle:install at the Karaf shell is the only way. I'll also experiment with adding an Ansible task for doing that bundle:install step, hopefully resulting in support for this use-case.

dfarrell07 commented 9 years ago

Per an IRC conversation with icbts of upstream Karaf, it looks like the only way to install bundles that aren't grouped into features is via interactive bundle:install commands at the Karaf shell. I raised #12 to track adding that feature.

dfarrell07 commented 9 years ago

Now that #12 is closed, it should be possible to do this. Would you like me to write up an example, @chenshuai123?

chenshuai123 commented 9 years ago

Hi Daniel, it's pretty good, thanks a lot for you doing so much effort for this.

chenshuai123 commented 9 years ago

Hi Daniel, I have a good news. I add "jolokia-osgi" to item "featuresBoot" in etc/org.apache.karaf.features.cfg based on the other 2 solutions as I mentioned above, it works.

opendaylight-user@root>bundle:list| grep -i jolo 383 | Active | 5 | 1.1.4 | Jolokia Agent

And if the ODL is not new installed, it's better to remove all contents in the Apache Karaf cache (in the KARAF_DATA folder(opendaylight-0.2.2/data)).

I googled a lot and I am sorry to forget which one inspired me.

Thanks a lot again.

dfarrell07 commented 9 years ago

I add "jolokia-osgi" to item "featuresBoot" in etc/org.apache.karaf.features.cfg based on the other 2 solutions as I mentioned above, it works.

I'm unable to recreate this. Can you provide some details (like the captured output below) to show that behavior?

[~/vagrant-opendaylight]$ vagrant up cent7_ansible
Bringing machine 'cent7_ansible' up with 'virtualbox' provider...
==> cent7_ansible: Importing base box 'chef/centos-7.0'...
==> cent7_ansible: Matching MAC address for NAT networking...
==> cent7_ansible: Checking if box 'chef/centos-7.0' is up to date...
==> cent7_ansible: Setting the name of the VM: vagrant-opendaylight_cent7_ansible_1432818722829_12981
==> cent7_ansible: Clearing any previously set network interfaces...
==> cent7_ansible: Preparing network interfaces based on configuration...
    cent7_ansible: Adapter 1: nat
==> cent7_ansible: Forwarding ports...
    cent7_ansible: 22 => 2222 (adapter 1)
==> cent7_ansible: Running 'pre-boot' VM customizations...
==> cent7_ansible: Booting VM...
==> cent7_ansible: Waiting for machine to boot. This may take a few minutes...
    cent7_ansible: SSH address: 127.0.0.1:2222
    cent7_ansible: SSH username: vagrant
    cent7_ansible: SSH auth method: private key
    cent7_ansible: Warning: Connection timeout. Retrying...
    cent7_ansible: 
    cent7_ansible: Vagrant insecure key detected. Vagrant will automatically replace
    cent7_ansible: this with a newly generated keypair for better security.
    cent7_ansible: 
    cent7_ansible: Inserting generated public key within guest...
    cent7_ansible: Removing insecure key from the guest if its present...
    cent7_ansible: Key inserted! Disconnecting and reconnecting using new SSH key...
==> cent7_ansible: Machine booted and ready!
==> cent7_ansible: Checking for guest additions in VM...
==> cent7_ansible: Mounting shared folders...
    cent7_ansible: /vagrant => /home/daniel/vagrant-opendaylight
==> cent7_ansible: Running provisioner: ansible...

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 | Configure ODL NB REST port] ***************************** 
changed: [cent7_ansible]

TASK: [opendaylight | Start ODL systemd service] ****************************** 
changed: [cent7_ansible]

NOTIFIED: [opendaylight | Stop ODL] ******************************************* 
changed: [cent7_ansible]

NOTIFIED: [opendaylight | Cleanup Karaf] ************************************** 
changed: [cent7_ansible]

NOTIFIED: [opendaylight | Start ODL] ****************************************** 
changed: [cent7_ansible]

PLAY RECAP ******************************************************************** 
cent7_ansible              : ok=9    changed=8    unreachable=0    failed=0   
[~/vagrant-opendaylight]$ grep -i extra_features\: provisioning/roles/opendaylight/vars/main.yml                                               
extra_features: ['jolokia-osgi']
[~/vagrant-opendaylight]$ grep -i jolokia provisioning/roles/opendaylight/templates/org.apache.karaf.features.cfg                       
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,mvn:org.jolokia/jolokia-osgi/1.1.4/xml/features
[~/vagrant-opendaylight]$ vagrant ssh cent7_ansible
[vagrant@localhost ~]$ grep -i jolokia /opt/opendaylight/etc/org.apache.karaf.features.cfg
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,mvn:org.jolokia/jolokia-osgi/1.1.4/xml/features
featuresBoot=config,standard,region,package,kar,ssh,management,jolokia-osgi
[vagrant@localhost ~]$ cd /vagrant/
[vagrant@localhost vagrant]$ ./scripts/connect.sh 
#snip
opendaylight-user@root>bundle:list | grep -i jolo
opendaylight-user@root>
chenshuai123 commented 9 years ago

Hi Daniel, my operation and output

root@final1:/home/opendaylight-ansible# ansible-playbook -i hosts odl-controller.yml

PLAY [odl_controller] *****

GATHERING FACTS *** ok: [odl_controller]

TASK: [odl-os | install opendaylight packages] **** ok: [odl_controller] => (item=openjdk-7-jdk)

TASK: [odl-os | create odl group] ***** ok: [odl_controller]

TASK: [odl-os | create odl user] ** ok: [odl_controller]

TASK: [odl-os | download odl package] ***** ok: [odl_controller]

TASK: [odl-os | extract odl package] ** changed: [odl_controller]

TASK: [odl-os | create karaf config] ** ok: [odl_controller]

TASK: [odl-os | create tomcat config] ***** ok: [odl_controller]

NOTIFIED: [odl-os | restart odl service] ** changed: [odl_controller]

PLAY RECAP **** odl_controller : ok=9 changed=2 unreachable=0 failed=0

root@final1:/home/opendaylight-ansible# cd /opt/opendaylight-0.2.2/ root@final1:/opt/opendaylight-0.2.2# cd bin/ root@final1:/opt/opendaylight-0.2.2/bin# ps fax | grep openday 1959 pts/2 S+ 0:00 | _ grep --color=auto openday root@final1:/opt/opendaylight-0.2.2/bin# root@final1:/opt/opendaylight-0.2.2/bin# root@final1:/opt/opendaylight-0.2.2/bin# root@final1:/opt/opendaylight-0.2.2/bin# root@final1:/opt/opendaylight-0.2.2/bin# root@final1:/opt/opendaylight-0.2.2/bin# ./karaf karaf: JAVA_HOME not set; results may vary

________                       ________                .__  .__       .__     __
\_____  \ ______   ____   ____ \______ \ _____  ___.__.|  | |__| ____ |  |___/  |_
 /   |   \\____ \_/ __ \ /    \ |    |  \\__  \<   |  ||  | |  |/ ___\|  |  \   __\
/    |    \  |_> >  ___/|   |  \|    `   \/ __ \\___  ||  |_|  / /_/  >   Y  \  |
\_______  /   __/ \___  >___|  /_______  (____  / ____||____/__\___  /|___|  /__|
        \/|__|        \/     \/        \/     \/\/            /_____/      \/

Hit '' for a list of available commands and '[cmd] --help' for help on a specific command. Hit '' or type 'system:shutdown' or 'logout' to shutdown OpenDaylight.

opendaylight-user@root>GossipRouter started at Fri May 29 01:35:14 UTC 2015 Listening on port 12001 bound on address 0.0.0.0/0.0.0.0 Backlog is 1000, linger timeout is 2000, and read timeout is 0 SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [bundleresource://104.fwk1509603467:1/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [bundleresource://104.fwk1509603467:2/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [bundleresource://104.fwk1509603467:3/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.slf4j.impl.JDK14LoggerFactory]

opendaylight-user@root> opendaylight-user@root> opendaylight-user@root> opendaylight-user@root>bundle:list | grep -i jolo opendaylight-user@root>logout root@final1:/opt/opendaylight-0.2.2/bin# root@final1:/opt/opendaylight-0.2.2/bin# root@final1:/opt/opendaylight-0.2.2/bin# root@final1:/opt/opendaylight-0.2.2/bin# root@final1:/opt/opendaylight-0.2.2/bin# cd .. root@final1:/opt/opendaylight-0.2.2# cd system/org/jolokia/jolokia-osgi/1.1.4/ root@final1:/opt/opendaylight-0.2.2/system/org/jolokia/jolokia-osgi/1.1.4# ll total 324 drwxr-xr-x 2 odl odl 4096 May 29 01:20 ./ drwxr-xr-x 3 odl odl 4096 May 29 01:20 ../ -rw-r--r-- 1 odl odl 312260 Jan 27 01:40 jolokia-osgi-1.1.4.jar -rw-r--r-- 1 odl odl 5681 Jan 27 01:40 jolokia-osgi-1.1.4.pom root@final1:/opt/opendaylight-0.2.2/system/org/jolokia/jolokia-osgi/1.1.4# vi jolokia-osgi-1.1.4-features.xml root@final1:/opt/opendaylight-0.2.2/system/org/jolokia/jolokia-osgi/1.1.4# cat jolokia-osgi-1.1.4-features.xml <?xml version="1.0" encoding="UTF-8" standalone="yes"?>

mvn:org.jolokia/jolokia-osgi/1.1.4/xml/features mvn:org.jolokia/jolokia-osgi/1.1.4

root@final1:/opt/opendaylight-0.2.2/system/org/jolokia/jolokia-osgi/1.1.4# cd /opt/opendaylight-0.2.2/etc/ root@final1:/opt/opendaylight-0.2.2/etc# ll total 208 drwxr-xr-x 3 odl odl 4096 May 29 01:34 ./ drwxr-xr-x 16 odl odl 4096 May 29 01:36 ../ -rw-r--r-- 1 odl odl 1035 Jan 27 05:04 all.policy -rw-r--r-- 1 odl odl 9045 Jan 27 05:04 config.properties -rw-r--r-- 1 odl odl 6191 Jan 27 01:47 custom.properties -rw-r--r-- 1 odl odl 1144 Jan 27 05:04 distribution.info -rw-r--r-- 1 odl odl 4616 Jan 27 05:04 equinox-debug.properties -rw-r--r-- 1 odl odl 1121 Jan 27 05:04 java.util.logging.properties -rw-r--r-- 1 root root 3570 May 29 01:34 jetty.xml -rw-r--r-- 1 odl odl 3532 Jan 27 05:04 jmx.acl.cfg -rw-r--r-- 1 odl odl 1115 Jan 27 05:04 jmx.acl.java.lang.Memory.cfg -rw-r--r-- 1 odl odl 1717 Jan 27 05:04 jmx.acl.org.apache.karaf.bundle.cfg -rw-r--r-- 1 odl odl 3303 Jan 27 05:04 jmx.acl.org.apache.karaf.config.cfg -rw-r--r-- 1 odl odl 1259 Jan 27 05:04 jmx.acl.org.apache.karaf.security.jmx.cfg -rw-r--r-- 1 odl odl 3661 Jan 27 05:04 jmx.acl.osgi.compendium.cm.cfg -rw-r--r-- 1 odl odl 14624 Jan 27 05:04 jre.properties -rw-r--r-- 1 odl odl 1894 Jan 27 05:04 keys.properties drwxr-xr-x 4 root root 4096 May 29 01:35 opendaylight/ -rw-r--r-- 1 odl odl 1253 Jan 27 05:04 org.apache.felix.fileinstall-deploy.cfg -rw-r--r-- 1 odl odl 1727 Jan 27 05:04 org.apache.karaf.command.acl.bundle.cfg -rw-r--r-- 1 odl odl 2013 Jan 27 05:04 org.apache.karaf.command.acl.config.cfg -rw-r--r-- 1 odl odl 1207 Jan 27 05:04 org.apache.karaf.command.acl.feature.cfg -rw-r--r-- 1 odl odl 1253 Jan 27 05:04 org.apache.karaf.command.acl.jaas.cfg -rw-r--r-- 1 odl odl 1207 Jan 27 05:04 org.apache.karaf.command.acl.kar.cfg -rw-r--r-- 1 odl odl 1226 Jan 27 05:04 org.apache.karaf.command.acl.shell.cfg -rw-r--r-- 1 odl odl 2850 Jan 27 05:04 org.apache.karaf.command.acl.system.cfg -rwxrwxr-x 1 odl odl 2666 May 29 01:20 org.apache.karaf.features.cfg -rw-r--r-- 1 odl odl 1483 Jan 27 05:04 org.apache.karaf.features.obr.cfg -rw-r--r-- 1 odl odl 1776 Jan 27 05:04 org.apache.karaf.features.repos.cfg -rw-r--r-- 1 odl odl 1665 Jan 27 05:04 org.apache.karaf.jaas.cfg -rw-r--r-- 1 odl odl 1115 Jan 27 05:04 org.apache.karaf.kar.cfg -rw-r--r-- 1 odl odl 1663 Jan 27 05:04 org.apache.karaf.log.cfg -rw-r--r-- 1 odl odl 1904 Jan 27 05:04 org.apache.karaf.management.cfg -rw-r--r-- 1 odl odl 2830 Jan 27 05:04 org.apache.karaf.shell.cfg -rw-r--r-- 1 root root 48 May 29 01:34 org.opendaylight.aaa.authn.cfg -rw-r--r-- 1 root root 47 May 29 01:34 org.opendaylight.aaa.federation.cfg -rw-r--r-- 1 root root 98 May 29 01:34 org.opendaylight.aaa.tokens.cfg -rw-r--r-- 1 odl odl 2340 Jan 27 05:04 org.ops4j.pax.logging.cfg -rw-r--r-- 1 odl odl 4894 Jan 27 05:04 org.ops4j.pax.url.mvn.cfg -rw-r--r-- 1 odl odl 1827 Jan 27 05:04 regions-config.xml -rw-r--r-- 1 odl odl 1253 Jan 27 05:04 shell.init.script -rw-r--r-- 1 odl odl 3079 Jan 27 05:04 startup.properties -rw-r--r-- 1 odl odl 3838 Jan 27 05:04 system.properties -rw-r--r-- 1 odl odl 1436 Jan 27 05:04 users.properties root@final1:/opt/opendaylight-0.2.2/etc# vi org.apache.karaf.features.cfg root@final1:/opt/opendaylight-0.2.2/etc# cd .. root@final1:/opt/opendaylight-0.2.2# ll total 88 drwxr-xr-x 16 odl odl 4096 May 29 01:36 ./ drwxr-xr-x 3 root root 4096 May 29 01:20 ../ -rw-r--r-- 1 odl odl 220 Apr 9 2014 .bash_logout -rw-r--r-- 1 odl odl 3637 Apr 9 2014 .bashrc drwxr-xr-x 2 odl odl 4096 Jan 27 01:47 bin/ drwxr-xr-x 3 root root 4096 May 29 01:36 cache/ drwxr-xr-x 3 odl odl 4096 May 29 01:36 configuration/ drwxr-xr-x 9 odl odl 4096 May 29 01:35 data/ drwxr-xr-x 2 odl odl 4096 May 29 01:20 deploy/ drwxr-xr-x 3 odl odl 4096 May 29 01:43 etc/ drwxr-xr-x 2 odl odl 4096 May 29 01:20 externalapps/ -rw-r--r-- 1 root root 7168 May 29 01:36 idmlight.db drwxr-xr-x 2 root root 4096 May 29 01:34 instances/ drwxr-xr-x 5 odl odl 4096 May 29 01:20 lib/ -rw-r--r-- 1 root root 0 May 29 01:34 lock drwxr-xr-x 2 root root 4096 May 29 01:35 logs/ drwxr-xr-x 3 root root 4096 May 29 01:35 ObjectStore/ -rw-r--r-- 1 odl odl 675 Apr 9 2014 .profile drwxr-xr-x 3 root root 4096 May 29 01:35 PutObjectStoreDirHere/ drwxr-xr-x 33 odl odl 4096 May 29 01:20 system/ -rw-r--r-- 1 odl odl 329 Jan 27 01:47 version.properties drwxr-xr-x 3 root root 4096 May 29 01:35 work/ root@final1:/opt/opendaylight-0.2.2# cd data/ root@final1:/opt/opendaylight-0.2.2/data# rm -rf root@final1:/opt/opendaylight-0.2.2/data# cd .. root@final1:/opt/opendaylight-0.2.2# ll total 88 drwxr-xr-x 16 odl odl 4096 May 29 01:36 ./ drwxr-xr-x 3 root root 4096 May 29 01:20 ../ -rw-r--r-- 1 odl odl 220 Apr 9 2014 .bash_logout -rw-r--r-- 1 odl odl 3637 Apr 9 2014 .bashrc drwxr-xr-x 2 odl odl 4096 Jan 27 01:47 bin/ drwxr-xr-x 3 root root 4096 May 29 01:36 cache/ drwxr-xr-x 3 odl odl 4096 May 29 01:36 configuration/ drwxr-xr-x 2 odl odl 4096 May 29 01:43 data/ drwxr-xr-x 2 odl odl 4096 May 29 01:20 deploy/ drwxr-xr-x 3 odl odl 4096 May 29 01:43 etc/ drwxr-xr-x 2 odl odl 4096 May 29 01:20 externalapps/ -rw-r--r-- 1 root root 7168 May 29 01:36 idmlight.db drwxr-xr-x 2 root root 4096 May 29 01:34 instances/ drwxr-xr-x 5 odl odl 4096 May 29 01:20 lib/ -rw-r--r-- 1 root root 0 May 29 01:34 lock drwxr-xr-x 2 root root 4096 May 29 01:35 logs/ drwxr-xr-x 3 root root 4096 May 29 01:35 ObjectStore/ -rw-r--r-- 1 odl odl 675 Apr 9 2014 .profile drwxr-xr-x 3 root root 4096 May 29 01:35 PutObjectStoreDirHere/ drwxr-xr-x 33 odl odl 4096 May 29 01:20 system/ -rw-r--r-- 1 odl odl 329 Jan 27 01:47 version.properties drwxr-xr-x 3 root root 4096 May 29 01:35 work/ root@final1:/opt/opendaylight-0.2.2# cd bin/ root@final1:/opt/opendaylight-0.2.2/bin# ./karaf karaf: JAVA_HOME not set; results may vary

________                       ________                .__  .__       .__     __
\_____  \ ______   ____   ____ \______ \ _____  ___.__.|  | |__| ____ |  |___/  |_
 /   |   \\____ \_/ __ \ /    \ |    |  \\__  \<   |  ||  | |  |/ ___\|  |  \   __\
/    |    \  |_> >  ___/|   |  \|    `   \/ __ \\___  ||  |_|  / /_/  >   Y  \  |
\_______  /   __/ \___  >___|  /_______  (____  / ____||____/__\___  /|___|  /__|
        \/|__|        \/     \/        \/     \/\/            /_____/      \/

Hit '' for a list of available commands and '[cmd] --help' for help on a specific command. Hit '' or type 'system:shutdown' or 'logout' to shutdown OpenDaylight.

opendaylight-user@root>GossipRouter started at Fri May 29 01:44:07 UTC 2015 Listening on port 12001 bound on address 0.0.0.0/0.0.0.0 Backlog is 1000, linger timeout is 2000, and read timeout is 0 SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [bundleresource://104.fwk1533664211:1/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [bundleresource://104.fwk1533664211:2/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [bundleresource://104.fwk1533664211:3/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.slf4j.impl.JDK14LoggerFactory]

opendaylight-user@root> opendaylight-user@root> opendaylight-user@root>bundle:list | grep -i jolo 383 | Active | 5 | 1.1.4 | Jolokia Agent opendaylight-user@root>

the org.apache.karaf.features.cfg file content:

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.2-Helium-SR2/xml/features,mvn:org.jolokia/jolokia-osgi/1.1.4/xml/features

featuresBoot= config,standard,region,package,kar,ssh,management,http,odl-base-all,odl-aaa-authn,odl-restconf,odl-nsf-all,odl-adsal-northbound,odl-mdsal-apidocs,odl-openflowplugin-all,odl-l2switch-switch,odl-ovsdb-plugin,odl-ovsdb-openstack,odl-ovsdb-northbound,odl-dlux-core,odl-restconf-all,odl-mdsal-clustering,odl-openflowplugin-flow-services,odl-netconf-connector,odl-netconf-connector-ssh,jolokia-osgi

and I'm sorry to finish my odl ansible script, so I did some operation manually

dfarrell07 commented 9 years ago

Thanks for the data, @chenshuai123. I tried again to recreate a non-interactive bundle (not grouped into a feature) install, using the config you documented. With the same featuresBoot, featuresRepositories and jolokia-osgi-1.1.4-features.xml, I'm still not seeing jolokia-osgi installed. I can install it via an interactive shell command (shown at the bottom), as suggested by icbts (support added in #12).

I don't know what your custom Ansible tasks are doing, which could be relevant to the different results. We're also running different versions of ODL (I'm using SR3, you're on 0.2.2).

I'll revisit this in the next few days if possible, need to work on some other stuff. Again, you should be able to install individual bundles with the task added in #12. That's the feature you were asking for, right? I'll document that process better ASAP, per #15.

[~/vagrant-opendaylight]$ vagrant destroy -f cent7_ansible
==> cent7_ansible: Forcing shutdown of VM...
==> cent7_ansible: Destroying VM and associated drives...
==> cent7_ansible: Running cleanup tasks for 'ansible' provisioner...
[~/vagrant-opendaylight]$ git status
On branch master
Your branch is up-to-date with 'origin/master'.

nothing to commit, working directory clean
[~/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/tmpluaSnF.tar HEAD
- extracting opendaylight to provisioning/roles/opendaylight
- opendaylight was installed successfully
[~/vagrant-opendaylight]$ cat provisioning/playbook.yml
---
- hosts: all
  sudo: yes
  roles:
    - opendaylight
[~/vagrant-opendaylight]$ vagrant up cent7_ansible
Bringing machine 'cent7_ansible' up with 'virtualbox' provider...
==> cent7_ansible: Importing base box 'chef/centos-7.0'...
==> cent7_ansible: Matching MAC address for NAT networking...
==> cent7_ansible: Checking if box 'chef/centos-7.0' is up to date...
==> cent7_ansible: Setting the name of the VM: vagrant-opendaylight_cent7_ansible_1432916684569_31143
==> cent7_ansible: Clearing any previously set network interfaces...
==> cent7_ansible: Preparing network interfaces based on configuration...
    cent7_ansible: Adapter 1: nat
==> cent7_ansible: Forwarding ports...
    cent7_ansible: 22 => 2222 (adapter 1)
==> cent7_ansible: Running 'pre-boot' VM customizations...
==> cent7_ansible: Booting VM...
==> cent7_ansible: Waiting for machine to boot. This may take a few minutes...
    cent7_ansible: SSH address: 127.0.0.1:2222
    cent7_ansible: SSH username: vagrant
    cent7_ansible: SSH auth method: private key
    cent7_ansible: Warning: Connection timeout. Retrying...
    cent7_ansible: 
    cent7_ansible: Vagrant insecure key detected. Vagrant will automatically replace
    cent7_ansible: this with a newly generated keypair for better security.
    cent7_ansible: 
    cent7_ansible: Inserting generated public key within guest...
    cent7_ansible: Removing insecure key from the guest if its present...
    cent7_ansible: Key inserted! Disconnecting and reconnecting using new SSH key...
==> cent7_ansible: Machine booted and ready!
==> cent7_ansible: Checking for guest additions in VM...
==> cent7_ansible: Mounting shared folders...
    cent7_ansible: /vagrant => /home/daniel/vagrant-opendaylight
==> cent7_ansible: Running provisioner: ansible...
PYTHONUNBUFFERED=1 ANSIBLE_FORCE_COLOR=true ANSIBLE_HOST_KEY_CHECKING=false ANSIBLE_SSH_ARGS='-o UserKnownHostsFile=/dev/null -o ControlMaster=auto -o ControlPersist=60s' ansible-playbook --private-key=/home/daniel/vagrant-opendaylight/.vagrant/machines/cent7_ansible/virtualbox/private_key --user=vagrant --connection=ssh --limit='cent7_ansible' --inventory-file=/home/daniel/vagrant-opendaylight/.vagrant/provisioners/ansible/inventory provisioning/playbook.yml

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 | Configure ODL NB REST port] ***************************** 
changed: [cent7_ansible]

TASK: [opendaylight | Start ODL systemd service] ****************************** 
changed: [cent7_ansible]

NOTIFIED: [opendaylight | Stop ODL] ******************************************* 
changed: [cent7_ansible]

NOTIFIED: [opendaylight | Cleanup Karaf] ************************************** 
changed: [cent7_ansible]

NOTIFIED: [opendaylight | Start ODL] ****************************************** 
changed: [cent7_ansible]

PLAY RECAP ******************************************************************** 
cent7_ansible              : ok=9    changed=8    unreachable=0    failed=0   

[~/vagrant-opendaylight]$ vagrant ssh cent7_ansible
Last login: Fri May 29 16:29:29 2015 from 10.0.2.2
[vagrant@localhost ~]$ cd /vagrant/scripts/
[vagrant@localhost scripts]$ ./connect.sh
#snip
opendaylight-user@root>bundle:list | grep -i jolo
opendaylight-user@root>^D
Connection to localhost closed.
[vagrant@localhost scripts]$ cat /opt/opendaylight/etc/org.apache.karaf.features.cfg | grep -i featuresBoot=
featuresBoot=config,standard,region,package,kar,ssh,management
[vagrant@localhost scripts]$ logout
Connection to 127.0.0.1 closed.
[~/vagrant-opendaylight]$ gvim -v provisioning/roles/opendaylight/vars/main.yml
# Added exactly the features you installed, except without jolokia-osgi
[~/vagrant-opendaylight]$ cat provisioning/roles/opendaylight/vars/main.yml | grep extra_featur
es\:
extra_features: ['http', 'odl-base-all', 'odl-aaa-authn', 'odl-restconf', 'odl-nsf-all', 'odl-adsal-northbound', 'odl-mdsal-apidocs', 'odl-openflowplugin-all', 'odl-l2switch-switch', 'odl-ovsdb-plugin', 'odl-ovsdb-openstack', 'odl-ovsdb-northbound', 'odl-dlux-core', 'odl-restconf-all', 'odl-mdsal-clustering', 'odl-openflowplugin-flow-services', 'odl-netconf-connector', 'odl-netconf-connector-ssh']
[~/vagrant-opendaylight]$ vagrant provision cent7_ansible                              14:38:42
==> cent7_ansible: Running provisioner: ansible...
PYTHONUNBUFFERED=1 ANSIBLE_FORCE_COLOR=true ANSIBLE_HOST_KEY_CHECKING=false ANSIBLE_SSH_ARGS='-o UserKnownHostsFile=/dev/null -o ControlMaster=auto -o ControlPersist=60s' ansible-playbook --private-key=/home/daniel/vagrant-opendaylight/.vagrant/machines/cent7_ansible/virtualbox/private_key --user=vagrant --connection=ssh --limit='cent7_ansible' --inventory-file=/home/daniel/vagrant-opendaylight/.vagrant/provisioners/ansible/inventory provisioning/playbook.yml

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 | Configure ODL NB REST port] ***************************** 
ok: [cent7_ansible]

TASK: [opendaylight | Start ODL systemd service] ****************************** 
ok: [cent7_ansible]

NOTIFIED: [opendaylight | Stop ODL] ******************************************* 
changed: [cent7_ansible]

NOTIFIED: [opendaylight | Cleanup Karaf] ************************************** 
changed: [cent7_ansible]

NOTIFIED: [opendaylight | Start ODL] ****************************************** 
changed: [cent7_ansible]

PLAY RECAP ******************************************************************** 
cent7_ansible              : ok=9    changed=4    unreachable=0    failed=0   

[~/vagrant-opendaylight]$ vagrant ssh cent7_ansible
Last login: Fri May 29 18:39:20 2015 from 10.0.2.2
[vagrant@localhost ~]$ cat /opt/opendaylight/etc/org.apache.karaf.features.cfg | grep -i featuresBoot=
featuresBoot=config,standard,region,package,kar,ssh,management,http,odl-base-all,odl-aaa-authn,odl-restconf,odl-nsf-all,odl-adsal-northbound,odl-mdsal-apidocs,odl-openflowplugin-all,odl-l2switch-switch,odl-ovsdb-plugin,odl-ovsdb-openstack,odl-ovsdb-northbound,odl-dlux-core,odl-restconf-all,odl-mdsal-clustering,odl-openflowplugin-flow-services,odl-netconf-connector,odl-netconf-connector-ssh
[vagrant@localhost ~]$ cd /vagrant/scripts/
[vagrant@localhost scripts]$ ./connect.sh
#snip
opendaylight-user@root>bundle:list | grep -i jolo
# Waited a while, as the VM was under heavy compute load.
opendaylight-user@root>bundle:list | grep -i jolo
opendaylight-user@root>
# Still no sign of the Jolokia bundle. At this point, I killed the CPU-overwhelmed VM. May need to re-test.
[~/vagrant-opendaylight]$ vagrant destroy -f cent7_ansible
#snip
# Modified vagrant-odl's VM hardware config to give it an extra CPU core.
[~/vagrant-opendaylight]$ git diff | cat
diff --git a/Vagrantfile b/Vagrantfile
index b9a15e0..5b4a25f 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -9,7 +9,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
   # Configure VM RAM and CPU. Change this to meet your needs.
   config.vm.provider "virtualbox" do |v|
     v.memory = 1024
-    v.cpus = 1
+    v.cpus = 2
   end

   #
[~/vagrant-opendaylight]$ gvim -v provisioning/roles/opendaylight/vars/main.yml
# Added the jolokia-osgi bundle, so exactly the same set used in chenshuai123's example
[~/vagrant-opendaylight]$ cat provisioning/roles/opendaylight/vars/main.yml | grep extra_features\:
extra_features: ['http', 'odl-base-all', 'odl-aaa-authn', 'odl-restconf', 'odl-nsf-all', 'odl-adsal-northbound', 'odl-mdsal-apidocs', 'odl-openflowplugin-all', 'odl-l2switch-switch', 'odl-ovsdb-plugin', 'odl-ovsdb-openstack', 'odl-ovsdb-northbound', 'odl-dlux-core', 'odl-restconf-all', 'odl-mdsal-clustering', 'odl-openflowplugin-flow-services', 'odl-netconf-connector', 'odl-netconf-connector-ssh', 'jolokia-osgi']
[~/vagrant-opendaylight]$ vagrant up cent7_ansible
Bringing machine 'cent7_ansible' up with 'virtualbox' provider...
==> cent7_ansible: Importing base box 'chef/centos-7.0'...
==> cent7_ansible: Matching MAC address for NAT networking...
==> cent7_ansible: Checking if box 'chef/centos-7.0' is up to date...
==> cent7_ansible: Setting the name of the VM: vagrant-opendaylight_cent7_ansible_1432925768692_3128
==> cent7_ansible: Clearing any previously set network interfaces...
==> cent7_ansible: Preparing network interfaces based on configuration...
    cent7_ansible: Adapter 1: nat
==> cent7_ansible: Forwarding ports...
    cent7_ansible: 22 => 2222 (adapter 1)
==> cent7_ansible: Running 'pre-boot' VM customizations...
==> cent7_ansible: Booting VM...
==> cent7_ansible: Waiting for machine to boot. This may take a few minutes...
    cent7_ansible: SSH address: 127.0.0.1:2222
    cent7_ansible: SSH username: vagrant
    cent7_ansible: SSH auth method: private key
    cent7_ansible: Warning: Connection timeout. Retrying...
    cent7_ansible: 
    cent7_ansible: Vagrant insecure key detected. Vagrant will automatically replace
    cent7_ansible: this with a newly generated keypair for better security.
    cent7_ansible: 
    cent7_ansible: Inserting generated public key within guest...
    cent7_ansible: Removing insecure key from the guest if its present...
    cent7_ansible: Key inserted! Disconnecting and reconnecting using new SSH key...
==> cent7_ansible: Machine booted and ready!
==> cent7_ansible: Checking for guest additions in VM...
==> cent7_ansible: Mounting shared folders...
    cent7_ansible: /vagrant => /home/daniel/vagrant-opendaylight
==> cent7_ansible: Running provisioner: ansible...
PYTHONUNBUFFERED=1 ANSIBLE_FORCE_COLOR=true ANSIBLE_HOST_KEY_CHECKING=false ANSIBLE_SSH_ARGS='-o UserKnownHostsFile=/dev/null -o ControlMaster=auto -o ControlPersist=60s' ansible-playbook --private-key=/home/daniel/vagrant-opendaylight/.vagrant/machines/cent7_ansible/virtualbox/private_key --user=vagrant --connection=ssh --limit='cent7_ansible' --inventory-file=/home/daniel/vagrant-opendaylight/.vagrant/provisioners/ansible/inventory provisioning/playbook.yml

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 | Configure ODL NB REST port] ***************************** 
changed: [cent7_ansible]

TASK: [opendaylight | Start ODL systemd service] ****************************** 
changed: [cent7_ansible]

NOTIFIED: [opendaylight | Stop ODL] ******************************************* 
changed: [cent7_ansible]

NOTIFIED: [opendaylight | Cleanup Karaf] ************************************** 
changed: [cent7_ansible]

NOTIFIED: [opendaylight | Start ODL] ****************************************** 
changed: [cent7_ansible]

PLAY RECAP ******************************************************************** 
cent7_ansible              : ok=9    changed=8    unreachable=0    failed=0   

[~/vagrant-opendaylight]$ vagrant ssh cent7_ansible
Last login: Fri May 29 18:58:47 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,http,odl-base-all,odl-aaa-authn,odl-restconf,odl-nsf-all,odl-adsal-northbound,odl-mdsal-apidocs,odl-openflowplugin-all,odl-l2switch-switch,odl-ovsdb-plugin,odl-ovsdb-openstack,odl-ovsdb-northbound,odl-dlux-core,odl-restconf-all,odl-mdsal-clustering,odl-openflowplugin-flow-services,odl-netconf-connector,odl-netconf-connector-ssh,jolokia-osgi
[vagrant@localhost ~]$ cd /vagrant/scripts/
[vagrant@localhost scripts]$ ./connect.sh
#snip
opendaylight-user@root>bundle:list | grep -i jolo
# I'm pretty sure it's a bundle, not a feature, but look there anyway
opendaylight-user@root>^D
Connection to localhost closed.
# No sign of the Jolokia bundle
# Now add the featuresRepo config step to the test
[vagrant@localhost scripts]$ cat /opt/opendaylight/etc/org.apache.karaf.features.cfg | grep -i featuresRepo
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
[~/vagrant-opendaylight]$ vagrant destroy -f cent7_ansible
==> cent7_ansible: Forcing shutdown of VM...
==> cent7_ansible: Destroying VM and associated drives...
==> cent7_ansible: Running cleanup tasks for 'ansible' provisioner...
[~/vagrant-opendaylight]$ gvim -v provisioning/roles/opendaylight/templates/org.apache.karaf.features.cfg
# Manually added the Jolokia repo. I'm going to add a Vagrant task for this. See issue #14.
[~/vagrant-opendaylight]$ cat provisioning/roles/opendaylight/templates/org.apache.karaf.features.cfg | grep -i featuresRepo
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,mvn:org.jolokia/jolokia-osgi/1.1.4/xml/features
[~/vagrant-opendaylight]$ vagrant up cent7_ansible                                     15:06:53
Bringing machine 'cent7_ansible' up with 'virtualbox' provider...
==> cent7_ansible: Importing base box 'chef/centos-7.0'...
==> cent7_ansible: Matching MAC address for NAT networking...
==> cent7_ansible: Checking if box 'chef/centos-7.0' is up to date...
==> cent7_ansible: Setting the name of the VM: vagrant-opendaylight_cent7_ansible_1432926501515_80405
==> cent7_ansible: Clearing any previously set network interfaces...
==> cent7_ansible: Preparing network interfaces based on configuration...
    cent7_ansible: Adapter 1: nat
==> cent7_ansible: Forwarding ports...
    cent7_ansible: 22 => 2222 (adapter 1)
==> cent7_ansible: Running 'pre-boot' VM customizations...
==> cent7_ansible: Booting VM...
==> cent7_ansible: Waiting for machine to boot. This may take a few minutes...
    cent7_ansible: SSH address: 127.0.0.1:2222
    cent7_ansible: SSH username: vagrant
    cent7_ansible: SSH auth method: private key
    cent7_ansible: Warning: Connection timeout. Retrying...
    cent7_ansible: 
    cent7_ansible: Vagrant insecure key detected. Vagrant will automatically replace
    cent7_ansible: this with a newly generated keypair for better security.
    cent7_ansible: 
    cent7_ansible: Inserting generated public key within guest...
    cent7_ansible: Removing insecure key from the guest if its present...
    cent7_ansible: Key inserted! Disconnecting and reconnecting using new SSH key...
==> cent7_ansible: Machine booted and ready!
==> cent7_ansible: Checking for guest additions in VM...
==> cent7_ansible: Mounting shared folders...
    cent7_ansible: /vagrant => /home/daniel/vagrant-opendaylight
==> cent7_ansible: Running provisioner: ansible...
PYTHONUNBUFFERED=1 ANSIBLE_FORCE_COLOR=true ANSIBLE_HOST_KEY_CHECKING=false ANSIBLE_SSH_ARGS='-o UserKnownHostsFile=/dev/null -o ControlMaster=auto -o ControlPersist=60s' ansible-playbook --private-key=/home/daniel/vagrant-opendaylight/.vagrant/machines/cent7_ansible/virtualbox/private_key --user=vagrant --connection=ssh --limit='cent7_ansible' --inventory-file=/home/daniel/vagrant-opendaylight/.vagrant/provisioners/ansible/inventory provisioning/playbook.yml

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 | Configure ODL NB REST port] ***************************** 
changed: [cent7_ansible]

TASK: [opendaylight | Start ODL systemd service] ****************************** 
changed: [cent7_ansible]

NOTIFIED: [opendaylight | Stop ODL] ******************************************* 
changed: [cent7_ansible]

NOTIFIED: [opendaylight | Cleanup Karaf] ************************************** 
changed: [cent7_ansible]

NOTIFIED: [opendaylight | Start ODL] ****************************************** 
changed: [cent7_ansible]

PLAY RECAP ******************************************************************** 
cent7_ansible              : ok=9    changed=8    unreachable=0    failed=0   

[~/vagrant-opendaylight]$ vagrant ssh cent7_ansible
Last login: Fri May 29 19:10:59 2015 from 10.0.2.2
[vagrant@localhost ~]$ cd /vagrant/scripts/
[vagrant@localhost scripts]$ ./connect.sh 
#snip
opendaylight-user@root>bundle:list | grep -i jolo
# VM CPU running at >120% for a while, wait ti be sure all bundles are installed 
opendaylight-user@root>bundle:list | grep -i jolo
# Still no Jolokia bundle, wait again
opendaylight-user@root>sleep -s 180
opendaylight-user@root>bundle:list | grep -i jolo
# Still no Jolokia bundle. I did expect to have it at this point, based on chenshuai123's example
opendaylight-user@root>^D
Connection to localhost closed.
# Verify correct config
[vagrant@localhost scripts]$ grep -i "featuresBoot\=\|featuresRepo" /opt/opendaylight/etc/org.apache.karaf.features.cfg 
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,mvn:org.jolokia/jolokia-osgi/1.1.4/xml/features
featuresBoot=config,standard,region,package,kar,ssh,management,http,odl-base-all,odl-aaa-authn,odl-restconf,odl-nsf-all,odl-adsal-northbound,odl-mdsal-apidocs,odl-openflowplugin-all,odl-l2switch-switch,odl-ovsdb-plugin,odl-ovsdb-openstack,odl-ovsdb-northbound,odl-dlux-core,odl-restconf-all,odl-mdsal-clustering,odl-openflowplugin-flow-services,odl-netconf-connector,odl-netconf-connector-ssh,jolokia-osgi
# Will now add the jolokia-osgi-1.1.4-features.xml step from chenshuai123's example to the test
[vagrant@localhost scripts]$ cd /opt/opendaylight/system/org/jolokia/jolokia-osgi/1.1.4/
[vagrant@localhost 1.1.4]$ sudo vi jolokia-osgi-1.1.4-features.xml
[vagrant@localhost 1.1.4]$ ls -l
total 320
-rw-r--r--. 1 root root    143 May 29 20:01 jolokia-osgi-1.1.4-features.xml
-rw-r--r--. 1 odl  odl  312260 Apr 17 06:58 jolokia-osgi-1.1.4.jar
-rw-r--r--. 1 odl  odl    5681 Apr 17 06:58 jolokia-osgi-1.1.4.pom
[vagrant@localhost 1.1.4]$ sudo chown odl:odl jolokia-osgi-1.1.4-features.xml
[vagrant@localhost 1.1.4]$ sudo rm -rf /opt/opendaylight/data/*
[vagrant@localhost ~]$ sudo systemctl stop opendaylight
[vagrant@localhost ~]$ sudo rm -rf /opt/opendaylight/data/*
[vagrant@localhost ~]$ sudo systemctl start opendaylight
[vagrant@localhost ~]$ sleep 120
[vagrant@localhost ~]$ cd /vagrant/scripts/
[vagrant@localhost scripts]$ ./connect.sh
#snip
opendaylight-user@root>bundle:list | grep -i jolo
opendaylight-user@root>
# Still not installed, unexpected given chenshuai123's example result
# I can install it with an interactive Karaf shell command (as provided as a task in #12)
opendaylight-user@root>bundle:install -s mvn:org.jolokia/jolokia-osgi/1.1.4
Bundle ID: 415
opendaylight-user@root>bundle:list | grep -i jolo
415 | Active   |  80 | 1.1.4                                     | Jolokia Agent                                                            
opendaylight-user@root>
chenshuai123 commented 9 years ago

Hi, Daniel, I downloaded odl from https://nexus.opendaylight.org/content/groups/public/org/opendaylight/integration/distribution-karaf/0.2.2-Helium-SR2/distribution-karaf-0.2.2-Helium-SR2.tar.gz

and I recreated odl manually on centos7 and it worked.

[root@bogon]/opt/opendaylight-0.2.2/bin# ./karaf karaf: JAVA_HOME not set; results may vary

________                       ________                .__  .__       .__     __
\_____  \ ______   ____   ____ \______ \ _____  ___.__.|  | |__| ____ |  |___/  |_
 /   |   \\____ \_/ __ \ /    \ |    |  \\__  \<   |  ||  | |  |/ ___\|  |  \   __\
/    |    \  |_> >  ___/|   |  \|    `   \/ __ \\___  ||  |_|  / /_/  >   Y  \  |
\_______  /   __/ \___  >___|  /_______  (____  / ____||____/__\___  /|___|  /__|
        \/|__|        \/     \/        \/     \/\/            /_____/      \/

Hit '' for a list of available commands and '[cmd] --help' for help on a specific command. Hit '' or type 'system:shutdown' or 'logout' to shutdown OpenDaylight.

opendaylight-user@root>bundle:list | grep -i jolo opendaylight-user@root>logout

[root@bogon]/opt/opendaylight-0.2.2/bin# cd .. [root@bogon]/opt/opendaylight-0.2.2# cd data [root@bogon]/opt/opendaylight-0.2.2/data# rm -rf * zsh: sure you want to delete all the files in /opt/opendaylight-0.2.2/data [yn]? y [root@bogon]/opt/opendaylight-0.2.2/data# ll total 0 [root@bogon]/opt/opendaylight-0.2.2/data# cd ..

[root@bogon]/opt/opendaylight-0.2.2/etc# vi org.apache.karaf.features.cfg [root@bogon]/opt/opendaylight-0.2.2/etc# cd .. [root@bogon]/opt/opendaylight-0.2.2# ll total 20 drwxr-xr-x 2 root root 4096 Jan 27 01:47 bin drwxr-xr-x 2 root root 98 May 30 04:14 configuration drwxr-xr-x 2 root root 6 May 30 06:22 data drwxr-xr-x 2 root root 19 May 30 04:14 deploy drwxr-xr-x 2 root root 4096 May 30 06:29 etc drwxr-xr-x 2 root root 137 May 30 04:14 externalapps drwxr-xr-x 2 root root 32 May 30 04:14 instances drwxr-xr-x 5 root root 4096 May 30 04:14 lib -rw-r--r-- 1 root root 0 May 30 04:14 lock drwxr-xr-x 33 root root 4096 May 30 04:14 system -rw-r--r-- 1 root root 329 Jan 27 01:47 version.properties [root@bogon]/opt/opendaylight-0.2.2# cd system/org/jolokia/jolokia-osgi/1.1.4 [root@bogon]/opt/opendaylight-0.2.2/system/org/jolokia/jolokia-osgi/1.1.4# ll total 316 -rw-r--r-- 1 root root 312260 Jan 27 01:40 jolokia-osgi-1.1.4.jar -rw-r--r-- 1 root root 5681 Jan 27 01:40 jolokia-osgi-1.1.4.pom [root@bogon]/opt/opendaylight-0.2.2/system/org/jolokia/jolokia-osgi/1.1.4# vi jolokia-osgi-1.1.4-features.xml [root@bogon]/opt/opendaylight-0.2.2/system/org/jolokia/jolokia-osgi/1.1.4# cd /opt/opendaylight-0.2.2/bin [root@bogon]/opt/opendaylight-0.2.2/bin# ./karaf karaf: JAVA_HOME not set; results may vary

________                       ________                .__  .__       .__     __
\_____  \ ______   ____   ____ \______ \ _____  ___.__.|  | |__| ____ |  |___/  |_
 /   |   \\____ \_/ __ \ /    \ |    |  \\__  \<   |  ||  | |  |/ ___\|  |  \   __\
/    |    \  |_> >  ___/|   |  \|    `   \/ __ \\___  ||  |_|  / /_/  >   Y  \  |
\_______  /   __/ \___  >___|  /_______  (____  / ____||____/__\___  /|___|  /__|
        \/|__|        \/     \/        \/     \/\/            /_____/      \/

Hit '' for a list of available commands and '[cmd] --help' for help on a specific command. Hit '' or type 'system:shutdown' or 'logout' to shutdown OpenDaylight.

opendaylight-user@root>bundle:list | grep -i jolo 383 | Active | 5 | 1.1.4 | Jolokia Agent opendaylight-user@root>logout

did you remove the content in karaf data directory before you restarted karaf ?

dfarrell07 commented 9 years ago

did you remove the content in karaf data directory before you restarted karaf ?

Yeah, I did.

vagrant@localhost 1.1.4]$ sudo rm -rf /opt/opendaylight/data/*

I suggest we try to formalize the example you've provided in Ansible logic, then work from that standard, fully described, deployment to debug any issues. As I understand the config changes you've documented, the only one not supported directly by this Ansible role at the moment is the creation of the jolokia-osgi-1.1.4-features.xml file. I'll hack a task together for that.

dfarrell07 commented 9 years ago

cb102a75acf38467898e29c57427f9a0ae2b80eb, 7feb22be3726113652ea1dbc4bc9196f997fa132 and 44170346b95ecbb0949df57f5c5ee30c332f5abc added the logic for creating the jolokia-osgi-1.1.4-features.xml file. To build a VM and provision it to match my understanding of the configuration you described above (except using the latest ODL, SR3), I'm using the vagrant-opendaylight project.

After cloning the vagrant-opendaylight repo, assuming you have Vagrant installed, these are the only changes required to replicate my understanding of your config:

[~/vagrant-opendaylight]$ git diff | cat
--- a/provisioning/playbook.yml
+++ b/provisioning/playbook.yml
@@ -1,5 +1,9 @@
 ---
 - hosts: all
   sudo: yes
+  tasks:
+    - include: roles/opendaylight/tasks/create_bundle_test_file.yml
   roles:
-    - opendaylight
+    - role: opendaylight
+      extra_features: ['http', 'odl-base-all', 'odl-aaa-authn', 'odl-restconf', 'odl-nsf-all', 'odl-adsal-northbound', 'odl-mdsal-apidocs', 'odl-openflowplugin-all', 'odl-l2switch-switch', 'odl-ovsdb-plugin', 'odl-ovsdb-openstack', 'odl-ovsdb-northbound', 'odl-dlux-core', 'odl-restconf-all', 'odl-mdsal-clustering', 'odl-openflowplugin-flow-services', 'odl-netconf-connector', 'odl-netconf-connector-ssh', 'jolokia-osgi']
+      extra_feature_repos: ['mvn:org.jolokia/jolokia-osgi/1.1.4/xml/features']

Optionally, give the VM an extra CPU core to deal with the large number of features installed:

--- a/Vagrantfile
+++ b/Vagrantfile
@@ -9,7 +9,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
   # Configure VM RAM and CPU. Change this to meet your needs.
   config.vm.provider "virtualbox" do |v|
     v.memory = 1024
-    v.cpus = 1
+    v.cpus = 2
   end

Be sure to pull the Ansible role with:

[~/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/tmp2ZMGGb.tar HEAD
- extracting opendaylight to provisioning/roles/opendaylight
- opendaylight was installed successfully

Now a simple vagrant up will build a CentOs7 box and provision it according to our Ansible playbook.

[~/vagrant-opendaylight]$ vagrant up cent7_ansible
Bringing machine 'cent7_ansible' up with 'virtualbox' provider...
==> cent7_ansible: Importing base box 'chef/centos-7.0'...
#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 | Configure ODL NB REST port] ***************************** 
changed: [cent7_ansible]

TASK: [opendaylight | Check if FirewallD service is running] ****************** 
ok: [cent7_ansible]

TASK: [opendaylight | Open ODL NB REST port via FirewallD] ******************** 
skipping: [cent7_ansible]

TASK: [opendaylight | Start ODL systemd service] ****************************** 
changed: [cent7_ansible]

TASK: [Create bundle test file] *********************************************** 
changed: [cent7_ansible]

NOTIFIED: [opendaylight | Stop ODL] ******************************************* 
changed: [cent7_ansible]

NOTIFIED: [opendaylight | Cleanup Karaf] ************************************** 
changed: [cent7_ansible]

NOTIFIED: [opendaylight | Start ODL] ****************************************** 
changed: [cent7_ansible]

PLAY RECAP ******************************************************************** 
cent7_ansible              : ok=11   changed=9    unreachable=0    failed=0

[~/vagrant-opendaylight]$ vagrant ssh cent7_ansible
Last login: Sat May 30 15:18:20 2015 from 10.0.2.2
[vagrant@localhost ~]$ sudo systemctl status opendaylight
opendaylight.service - OpenDaylight SDN Controller
   Loaded: loaded (/usr/lib/systemd/system/opendaylight.service; enabled)
   Active: active (running) since Sat 2015-05-30 15:18:20 UTC; 1min 49s ago
     Docs: https://wiki.opendaylight.org/view/Main_Page
           http://www.opendaylight.org/
  Process: 11136 ExecStart=/opt/opendaylight/bin/start (code=exited, status=0/SUCCESS)
 Main PID: 11143 (java)
   CGroup: /system.slice/opendaylight.service
           └─11143 java -server -Xms128M -Xmx2048m -XX:+UnlockDiagnosticVMOptions -XX:+Unsyn...

May 30 15:18:20 localhost.localdomain systemd[1]: Starting OpenDaylight SDN Controller...
May 30 15:18:20 localhost.localdomain systemd[1]: Started OpenDaylight SDN Controller.
[vagrant@localhost ~]$ cd /vagrant/scripts/
[vagrant@localhost scripts]$ ./connect.sh
#snip
opendaylight-user@root>bundle:list | grep -i jolo
opendaylight-user@root>sleep -s 240
opendaylight-user@root>bundle:list | grep -i jolo
opendaylight-user@root>^D
Connection to localhost closed.
[vagrant@localhost scripts]$

The featuresRepositories config change seems correct:

[vagrant@localhost ~]$ grep featuresRepo /opt/opendaylight/etc/org.apache.karaf.features.cfg 
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,mvn:org.jolokia/jolokia-osgi/1.1.4/xml/features

As does featuresBoot:

featuresBoot=config,standard,region,package,kar,ssh,management,http,odl-base-all,odl-aaa-authn,odl-restconf,odl-nsf-all,odl-adsal-northbound,odl-mdsal-apidocs,odl-openflowplugin-all,odl-l2switch-switch,odl-ovsdb-plugin,odl-ovsdb-openstack,odl-ovsdb-northbound,odl-dlux-core,odl-restconf-all,odl-mdsal-clustering,odl-openflowplugin-flow-services,odl-netconf-connector,odl-netconf-connector-ssh,jolokia-osgi

And finally, the jolokia-osgi-1.1.4-features.xml file:

[vagrant@localhost ~]$ cat /opt/opendaylight/system/org/jolokia/jolokia-osgi/1.1.4/jolokia-osgi-1.1.4-features.xml 
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

mvn:org.jolokia/jolokia-osgi/1.1.4/xml/features

mvn:org.jolokia/jolokia-osgi/1.1.4

[vagrant@localhost ~]$
chenshuai123 commented 9 years ago

Hi Daniel, my jolokia-osgi-1.1.4-features.xml file is a little bit different from yours.

I find the problem, this page changed my xml file content, so sorry I didnt check out what I put here. I send mail to you. I also work for opnfv.