Shell Permission denied

123 views
Skip to first unread message

gfu...@gmail.com

unread,
Oct 21, 2015, 7:11:25 PM10/21/15
to Ansible Project
A simple task of listing/removing/installing a ElasticSearch plugin has got me baffled!  What am I missing here?

Here's my playbook:
---
- hosts: esserver
  gather_facts: false
  become: true
  become_user: root
  become_method: sudo


  tasks:

    - name: List Plugins
      shell: /usr/share/elasticsearch/bin/plugin --list



Here's the error message I'm getting:
failed: [esserver] => {"changed": true, "cmd": "/usr/share/elasticsearch/bin/plugin --list", "delta": "0:00:00.003698", "end": "2015-10-21 19:05:01.014884", "rc": 126, "start": "2015-10-21 19:05:01.011186", "warnings": []}
stderr: /usr/share/elasticsearch/bin/plugin: 48: exec: : Permission denied

FATAL: all hosts have already failed -- aborting





I have no problems running this command in the terminal:
username@esserver:~$ /usr/share/elasticsearch/bin/plugin -l
Installed plugins:
    - marvel
    - support-diagnostics

Greg Bell

unread,
Oct 21, 2015, 7:54:15 PM10/21/15
to Ansible Project
My OCD is noticing that Ansible's running --list, but you use -l from the command line.  Of course no difference, right?

I don't know what the problem is, but maybe it's not becoming root?  Can you shell:whoami?

gfu...@gmail.com

unread,
Oct 21, 2015, 8:30:32 PM10/21/15
to Ansible Project
shell: whoami is returning root.  But root access isn't required to run that script from the command line.

changed: [esserver] => {"changed": true, "cmd": "whoami", "delta": "0:00:00.014084", "end": "2015-10-21 20:28:46.975832", "rc": 0, "start": "2015-10-21 20:28:46.961748", "stderr": "", "stdout": "root", "warnings": []}

gfu...@gmail.com

unread,
Oct 21, 2015, 9:28:20 PM10/21/15
to Ansible Project
It appears to be something that the /usr/share/elasticsearch/bin/plugin script is trying to do with the older version of ES(1.5.3) that I'm trying to run this command on.  Updated ES to 1.7.1 and my Ansible shell stuff is working fine.
Reply all
Reply to author
Forward
0 new messages