{"action":"created","issue":{"url":"https://api.github.com/repos/dfarrell07/ansible-opendaylight/issues/7","labels_url":"https://api.github.com/repos/dfarrell07/ansible-opendaylight/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/dfarrell07/ansible-opendaylight/issues/7/comments","events_url":"https://api.github.com/repos/dfarrell07/ansible-opendaylight/issues/7/events","html_url":"https://github.com/dfarrell07/ansible-opendaylight/issues/7","id":76870357,"number":7,"title":"ODL Karaf features not removed after service restart","user":{"login":"dfarrell07","id":880273,"avatar_url":"https://avatars.githubusercontent.com/u/880273?v=3","gravatar_id":"","url":"https://api.github.com/users/dfarrell07","html_url":"https://github.com/dfarrell07","followers_url":"https://api.github.com/users/dfarrell07/followers","following_url":"https://api.github.com/users/dfarrell07/following{/other_user}","gists_url":"https://api.github.com/users/dfarrell07/gists{/gist_id}","starred_url":"https://api.github.com/users/dfarrell07/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dfarrell07/subscriptions","organizations_url":"https://api.github.com/users/dfarrell07/orgs","repos_url":"https://api.github.com/users/dfarrell07/repos","events_url":"https://api.github.com/users/dfarrell07/events{/privacy}","received_events_url":"https://api.github.com/users/dfarrell07/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dfarrell07/ansible-opendaylight/labels/info:progress-25","name":"info:progress-25","color":"009800"},{"url":"https://api.github.com/repos/dfarrell07/ansible-opendaylight/labels/prio:normal","name":"prio:normal","color":"fbca04"},{"url":"https://api.github.com/repos/dfarrell07/ansible-opendaylight/labels/type:bug","name":"type:bug","color":"0052cc"}],"state":"open","locked":false,"assignee":{"login":"dfarrell07","id":880273,"avatar_url":"https://avatars.githubusercontent.com/u/880273?v=3","gravatar_id":"","url":"https://api.github.com/users/dfarrell07","html_url":"https://github.com/dfarrell07","followers_url":"https://api.github.com/users/dfarrell07/followers","following_url":"https://api.github.com/users/dfarrell07/following{/other_user}","gists_url":"https://api.github.com/users/dfarrell07/gists{/gist_id}","starred_url":"https://api.github.com/users/dfarrell07/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dfarrell07/subscriptions","organizations_url":"https://api.github.com/users/dfarrell07/orgs","repos_url":"https://api.github.com/users/dfarrell07/repos","events_url":"https://api.github.com/users/dfarrell07/events{/privacy}","received_events_url":"https://api.github.com/users/dfarrell07/received_events","type":"User","site_admin":false},"milestone":null,"comments":8,"created_at":"2015-05-15T21:59:00Z","updated_at":"2015-05-21T23:52:51Z","closed_at":null,"body":"As of 0927d39d7de629c7a2f3fa094ec64e3259c2574a, using the [vagrant-opendaylight](https://github.com/dfarrell07/vagrant-opendaylight/) project to test a Vagrant box provisioned with this role.\r\n\r\nStarting with a fresh VM and default Ansible role vars:\r\n\r\n```\r\n[~/vagrant-opendaylight]$ vagrant destroy -f cent7_ansible\r\n<snip>\r\n[~/vagrant-opendaylight]$ ansible-galaxy install -r requirements.yml --force\r\n- executing: git clone https://github.com/dfarrell07/ansible-opendaylight opendaylight\r\n- executing: git archive --prefix=opendaylight/ --output=/tmp/tmpRSX32Z.tar HEAD\r\n- extracting opendaylight to provisioning/roles/opendaylight\r\n- opendaylight was installed successfully\r\n[~/vagrant-opendaylight]$ vagrant up cent7_ansible\r\nBringing machine 'cent7_ansible' up with 'virtualbox' provider...\r\n<snip>\r\nPLAY [all] ******************************************************************** \r\n\r\nGATHERING FACTS *************************************************************** \r\nok: [cent7_ansible]\r\n\r\nTASK: [opendaylight | Add ODL yum repo] *************************************** \r\nchanged: [cent7_ansible]\r\n\r\nTASK: [opendaylight | Install ODL RPM] **************************************** \r\nchanged: [cent7_ansible]\r\n\r\nTASK: [opendaylight | Configure ODL Karaf features] *************************** \r\nchanged: [cent7_ansible]\r\n\r\nTASK: [opendaylight | Start ODL systemd service] ****************************** \r\nchanged: [cent7_ansible]\r\n\r\nNOTIFIED: [opendaylight | Restart ODL] **************************************** \r\nchanged: [cent7_ansible]\r\n\r\nPLAY RECAP ******************************************************************** \r\ncent7_ansible              : ok=6    changed=5    unreachable=0    failed=0   \r\n```\r\n\r\nConnecting to the new box and poking around, I see the expected Karaf feature config:\r\n\r\n```\r\n[~/vagrant-opendaylight]$ vagrant ssh cent7_ansible\r\nLast login: Fri May 15 21:20:41 2015 from 10.0.2.2\r\n[vagrant@localhost ~]$ cat /opt/opendaylight/etc/org.apache.karaf.features.cfg | grep featuresBoot=\r\nfeaturesBoot=config,standard,region,package,kar,ssh,management\r\n```\r\n\r\nAlso, 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):\r\n\r\n```\r\n[vagrant@localhost ~]$ cd /vagrant/scripts/\r\n[vagrant@localhost scripts]$ ./connect.sh\r\n<snip>\r\n    ________                       ________                .__  .__       .__     __       \r\n    \\_____  \\ ______   ____   ____ \\______ \\ _____  ___.__.|  | |__| ____ |  |___/  |_     \r\n     /   |   \\\\____ \\_/ __ \\ /    \\ |    |  \\\\__  \\<   |  ||  | |  |/ ___\\|  |  \\   __\\    \r\n    /    |    \\  |_> >  ___/|   |  \\|    `   \\/ __ \\\\___  ||  |_|  / /_/  >   Y  \\  |      \r\n    \\_______  /   __/ \\___  >___|  /_______  (____  / ____||____/__\\___  /|___|  /__|      \r\n            \\/|__|        \\/     \\/        \\/     \\/\\/            /_____/      \\/          \r\n                                                                                           \r\n\r\nHit '<tab>' for a list of available commands\r\nand '[cmd] --help' for help on a specific command.\r\nHit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown OpenDaylight.\r\n\r\nopendaylight-user@root>feature:list | grep openstack\r\nodl-ovsdb-openstack                   | 1.0.3-Helium-SR3    |           | ovsdb-1.0.3-Helium-SR3                   | OpenDaylight :: OVSDB :: OpenStack Network Virtual\r\n```\r\n\r\nManually editing the `extra_features` value of the role in the vagrant-odl project to add `odl-ovsdb-openstack':\r\n\r\n```\r\n[~/vagrant-opendaylight]$ cat provisioning/roles/opendaylight/vars/main.yml | grep extra_featur\r\nes:\r\nextra_features: ['odl-ovsdb-openstack']\r\n```\r\n\r\nThen re-provisioning:\r\n\r\n```\r\n[~/vagrant-opendaylight]$ vagrant provision cent7_ansible\r\n<snip>\r\nPLAY [all] ******************************************************************** \r\n\r\nGATHERING FACTS *************************************************************** \r\nok: [cent7_ansible]\r\n\r\nTASK: [opendaylight | Add ODL yum repo] *************************************** \r\nok: [cent7_ansible]\r\n\r\nTASK: [opendaylight | Install ODL RPM] **************************************** \r\nok: [cent7_ansible]\r\n\r\nTASK: [opendaylight | Configure ODL Karaf features] *************************** \r\nchanged: [cent7_ansible]\r\n\r\nTASK: [opendaylight | Start ODL systemd service] ****************************** \r\nok: [cent7_ansible]\r\n\r\nNOTIFIED: [opendaylight | Restart ODL] **************************************** \r\nchanged: [cent7_ansible]\r\n\r\nPLAY RECAP ******************************************************************** \r\ncent7_ansible              : ok=6    changed=2    unreachable=0    failed=0   \r\n```\r\n\r\nI see the correct Karaf feature config updates:\r\n\r\n```\r\n[~/vagrant-opendaylight]$ vagrant ssh cent7_ansible\r\nLast login: Fri May 15 21:46:04 2015 from 10.0.2.2\r\n[vagrant@localhost ~]$ cat /opt/opendaylight/etc/org.apache.karaf.features.cfg | grep featuresBoot=\r\nfeaturesBoot=config,standard,region,package,kar,ssh,management,odl-ovsdb-openstack\r\n```\r\n\r\nAnd the non-standard feature is installed, as expected:\r\n\r\n```\r\n[vagrant@localhost ~]$ cd /vagrant/scripts/\r\n[vagrant@localhost scripts]$ ./connect.sh \r\nWill repeatedly attempt connecting to Karaf shell until it's ready\r\nWarning: Permanently added '[localhost]:8101' (DSA) to the list of known hosts.\r\nAuthenticated with partial success.\r\n                                                                                           \r\n    ________                       ________                .__  .__       .__     __       \r\n    \\_____  \\ ______   ____   ____ \\______ \\ _____  ___.__.|  | |__| ____ |  |___/  |_     \r\n     /   |   \\\\____ \\_/ __ \\ /    \\ |    |  \\\\__  \\<   |  ||  | |  |/ ___\\|  |  \\   __\\    \r\n    /    |    \\  |_> >  ___/|   |  \\|    `   \\/ __ \\\\___  ||  |_|  / /_/  >   Y  \\  |      \r\n    \\_______  /   __/ \\___  >___|  /_______  (____  / ____||____/__\\___  /|___|  /__|      \r\n            \\/|__|        \\/     \\/        \\/     \\/\\/            /_____/      \\/          \r\n                                                                                           \r\n\r\nHit '<tab>' for a list of available commands\r\nand '[cmd] --help' for help on a specific command.\r\nHit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown OpenDaylight.\r\n\r\nopendaylight-user@root>feature:list | grep openstack\r\nodl-ovsdb-openstack                   | 1.0.3-Helium-SR3    | x         | ovsdb-1.0.3-Helium-SR3                   | OpenDaylight :: OVSDB :: OpenStack Network Virtual\r\n```\r\n\r\n**Everything up to this point works as expected.**\r\n\r\nNow, removing the `extra_feature` from the vars in vagrant-odl:\r\n\r\n```\r\n[~/vagrant-opendaylight]$ cat provisioning/roles/opendaylight/vars/main.yml | grep extra_features:\r\nextra_features: []\r\n```\r\n\r\nAnd re-provisioning:\r\n\r\n```\r\n[~/vagrant-opendaylight]$ vagrant provision cent7_ansible\r\n<snip>\r\nPLAY [all] ******************************************************************** \r\n\r\nGATHERING FACTS *************************************************************** \r\nok: [cent7_ansible]\r\n\r\nTASK: [opendaylight | Add ODL yum repo] *************************************** \r\nok: [cent7_ansible]\r\n\r\nTASK: [opendaylight | Install ODL RPM] **************************************** \r\nok: [cent7_ansible]\r\n\r\nTASK: [opendaylight | Configure ODL Karaf features] *************************** \r\nchanged: [cent7_ansible]\r\n\r\nTASK: [opendaylight | Start ODL systemd service] ****************************** \r\nok: [cent7_ansible]\r\n\r\nNOTIFIED: [opendaylight | Restart ODL] **************************************** \r\nchanged: [cent7_ansible]\r\n\r\nPLAY RECAP ******************************************************************** \r\ncent7_ansible              : ok=6    changed=2    unreachable=0    failed=0\r\n```\r\n\r\nI see the Karaf features updated as expected:\r\n\r\n```\r\n[~/vagrant-opendaylight]$ vagrant ssh cent7_ansible\r\nLast login: Fri May 15 21:52:48 2015 from 10.0.2.2\r\n[vagrant@localhost ~]$ cat /opt/opendaylight/etc/org.apache.karaf.features.cfg | grep featuresBoot=\r\nfeaturesBoot=config,standard,region,package,kar,ssh,management\r\n```\r\n\r\n**But**, the non-standard feature is still installed:\r\n\r\n```\r\n[vagrant@localhost ~]$ cd /vagrant/scripts/\r\n[vagrant@localhost scripts]$ ./connect.sh \r\nWill repeatedly attempt connecting to Karaf shell until it's ready\r\nWarning: Permanently added '[localhost]:8101' (DSA) to the list of known hosts.\r\nAuthenticated with partial success.\r\n                                                                                           \r\n    ________                       ________                .__  .__       .__     __       \r\n    \\_____  \\ ______   ____   ____ \\______ \\ _____  ___.__.|  | |__| ____ |  |___/  |_     \r\n     /   |   \\\\____ \\_/ __ \\ /    \\ |    |  \\\\__  \\<   |  ||  | |  |/ ___\\|  |  \\   __\\    \r\n    /    |    \\  |_> >  ___/|   |  \\|    `   \\/ __ \\\\___  ||  |_|  / /_/  >   Y  \\  |      \r\n    \\_______  /   __/ \\___  >___|  /_______  (____  / ____||____/__\\___  /|___|  /__|      \r\n            \\/|__|        \\/     \\/        \\/     \\/\\/            /_____/      \\/          \r\n                                                                                           \r\n\r\nHit '<tab>' for a list of available commands\r\nand '[cmd] --help' for help on a specific command.\r\nHit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown OpenDaylight.\r\n\r\nopendaylight-user@root>feature:list | grep openstack\r\nodl-ovsdb-openstack                   | 1.0.3-Helium-SR3    | x         | ovsdb-1.0.3-Helium-SR3                   | OpenDaylight :: OVSDB :: OpenStack Network Virtual\r\n```\r\n\r\nThat'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."},"comment":{"url":"https://api.github.com/repos/dfarrell07/ansible-opendaylight/issues/comments/104452683","html_url":"https://github.com/dfarrell07/ansible-opendaylight/issues/7#issuecomment-104452683","issue_url":"https://api.github.com/repos/dfarrell07/ansible-opendaylight/issues/7","id":104452683,"user":{"login":"jgoodyear","id":402721,"avatar_url":"https://avatars.githubusercontent.com/u/402721?v=3","gravatar_id":"","url":"https://api.github.com/users/jgoodyear","html_url":"https://github.com/jgoodyear","followers_url":"https://api.github.com/users/jgoodyear/followers","following_url":"https://api.github.com/users/jgoodyear/following{/other_user}","gists_url":"https://api.github.com/users/jgoodyear/gists{/gist_id}","starred_url":"https://api.github.com/users/jgoodyear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgoodyear/subscriptions","organizations_url":"https://api.github.com/users/jgoodyear/orgs","repos_url":"https://api.github.com/users/jgoodyear/repos","events_url":"https://api.github.com/users/jgoodyear/events{/privacy}","received_events_url":"https://api.github.com/users/jgoodyear/received_events","type":"User","site_admin":false},"created_at":"2015-05-21T23:52:51Z","updated_at":"2015-05-21T23:52:51Z","body":"Generally, one would set their log folder to a directory outside of data.\nODL should be doing that in the custom distribution.\n\nThe CLI is usually the better way to perform tasks on Karaf.\n\nYou should be able to pass commands into Karaf via karaf client + command.\n\nDeleting the data folder will topple a Karaf pretty quickly - that's the\npersistent backing to the container. When you delete it, Karaf will have to\nreassemble itself on the next reboot, re-establishing its wiring.\n\nCheers,\nJamie\n\nOn Thu, May 21, 2015 at 8:29 PM, Daniel Farrell <notifications@github.com>\nwrote:\n\n> I might be able to use the executable option\n> <http://docs.ansible.com/command_module.html#options> to the shell\n> <http://docs.ansible.com/shell_module.html> or command\n> <http://docs.ansible.com/command_module.html> Ansible modules to point at\n> the Karaf shell executable, enabling elegant Karaf shell commands (like the\n> Karaf feature-related ones above).\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/dfarrell07/ansible-opendaylight/issues/7#issuecomment-104444725>\n> .\n>\n"}}