{"action":"opened","issue":{"url":"https://api.github.com/repos/elastic/cookbook-elasticsearch/issues/382","labels_url":"https://api.github.com/repos/elastic/cookbook-elasticsearch/issues/382/labels{/name}","comments_url":"https://api.github.com/repos/elastic/cookbook-elasticsearch/issues/382/comments","events_url":"https://api.github.com/repos/elastic/cookbook-elasticsearch/issues/382/events","html_url":"https://github.com/elastic/cookbook-elasticsearch/issues/382","id":109993613,"number":382,"title":"plugin install does not work","user":{"login":"runningman84","id":1699128,"avatar_url":"https://avatars.githubusercontent.com/u/1699128?v=3","gravatar_id":"","url":"https://api.github.com/users/runningman84","html_url":"https://github.com/runningman84","followers_url":"https://api.github.com/users/runningman84/followers","following_url":"https://api.github.com/users/runningman84/following{/other_user}","gists_url":"https://api.github.com/users/runningman84/gists{/gist_id}","starred_url":"https://api.github.com/users/runningman84/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/runningman84/subscriptions","organizations_url":"https://api.github.com/users/runningman84/orgs","repos_url":"https://api.github.com/users/runningman84/repos","events_url":"https://api.github.com/users/runningman84/events{/privacy}","received_events_url":"https://api.github.com/users/runningman84/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-06T12:01:57Z","updated_at":"2015-10-06T12:01:57Z","closed_at":null,"body":"I looks like the plugin command does not work if the elasticsearch folder is owned by root (which is the default).\r\n\r\n```\r\n         * service[elasticsearch] action nothing (skipped due to action :nothing)\r\n         * elasticsearch_plugin[mobz/elasticsearch-head] action install[2015-10-06T11:53:32+00:00] WARN: Class Chef::Provider::ElasticsearchPlugin does not declare 'resource_name :elasticsearch_plugin'.\r\n       [2015-10-06T11:53:32+00:00] WARN: This will no longer work in Chef 13: you must use 'resource_name' to provide DSL.\r\n       \r\n           \r\n           ================================================================================\r\n           Error executing action `install` on resource 'elasticsearch_plugin[mobz/elasticsearch-head]'\r\n           ================================================================================\r\n           \r\n           Mixlib::ShellOut::ShellCommandFailed\r\n           ------------------------------------\r\n           Expected process to exit with [0], but received '74'\r\n           ---- Begin output of [\"/usr/local/bin/plugin\", \"-install\", \"mobz/elasticsearch-head\"] ----\r\n           STDOUT: -> Installing mobz/elasticsearch-head...\r\n           Failed to install mobz/elasticsearch-head, reason: plugin directory /usr/local/elasticsearch-1.7.2/plugins is read only\r\n           STDERR: \r\n           ---- End output of [\"/usr/local/bin/plugin\", \"-install\", \"mobz/elasticsearch-head\"] ----\r\n           Ran [\"/usr/local/bin/plugin\", \"-install\", \"mobz/elasticsearch-head\"] returned 74\r\n           \r\n           Cookbook Trace:\r\n           ---------------\r\n           /tmp/kitchen/cache/cookbooks/elasticsearch/libraries/provider_plugin.rb:26:in `block (2 levels) in <class:ElasticsearchPlugin>'\r\n           /tmp/kitchen/cache/cookbooks/elasticsearch/libraries/provider_plugin.rb:14:in `block in <class:ElasticsearchPlugin>'\r\n           \r\n           Resource Declaration:\r\n           ---------------------\r\n       # In /tmp/kitchen/cache/cookbooks/asy-graylog2/recipes/elasticsearch.rb\r\n       \r\n            39: elasticsearch_plugin 'mobz/elasticsearch-head'\r\n           \r\n           Compiled Resource:\r\n       ------------------\r\n       # Declared in /tmp/kitchen/cache/cookbooks/asy-graylog2/recipes/elasticsearch.rb:39:in `from_file'\r\n           \r\n           elasticsearch_plugin(\"mobz/elasticsearch-head\") do\r\n         action [:install]\r\n             retries 0\r\n         retry_delay 2\r\n             default_guard_interpreter :default\r\n             declared_type :elasticsearch_plugin\r\n             cookbook_name \"asy-graylog2\"\r\n             recipe_name \"elasticsearch\"\r\n             plugin_name \"mobz/elasticsearch-head\"\r\n             plugin_dir \"/usr/local/elasticsearch/plugins\"\r\n             bindir \"/usr/local/bin\"\r\n         user \"elasticsearch\"\r\n             group \"elasticsearch\"               \r\n```"}}