Install hook fails with error `Ansible playbook failed`

Bug #2013065 reported by Sudeep Bhandari
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Elasticsearch Charm
Invalid
Undecided
Unassigned

Bug Description

To reproduce,
```
juju deploy elasticsearch
```
The install hook will fail with the following logs in unit's /var/log/juju:

2023-03-28 11:07:58 ERROR unit.elasticsearch/0.juju-log server.go:316 Ansible playbook failed with Command '['ansible-playbook', '-vvv', '-c', 'local', 'playbook.yaml', '--tags', 'install']' returned non-zero exit status 2.
2023-03-28 11:07:58 ERROR unit.elasticsearch/0.juju-log server.go:316 Stdout: ansible-playbook 2.9.6
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  executable location = /usr/bin/ansible-playbook
  python version = 3.8.10 (default, Mar 13 2023, 10:26:41) [GCC 9.4.0]
Using /etc/ansible/ansible.cfg as config file
host_list declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
script declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
auto declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Parsed /etc/ansible/hosts inventory source with ini plugin
statically imported: /var/lib/juju/agents/unit-elasticsearch-0/charm/tasks/install-elasticsearch.yml
statically imported: /var/lib/juju/agents/unit-elasticsearch-0/charm/tasks/peer-relations.yml
statically imported: /var/lib/juju/agents/unit-elasticsearch-0/charm/tasks/setup-ufw.yml

PLAYBOOK: playbook.yaml ********************************************************
1 plays in playbook.yaml

PLAY [localhost] ***************************************************************

TASK [Gathering Facts] *********************************************************
task path: /var/lib/juju/agents/unit-elasticsearch-0/charm/playbook.yaml:1
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: root
<localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp/ansible-tmp-1680001664.0923839-130917866573098 `" && echo ansible-tmp-1680001664.0923839-130917866573098="` echo /root/.ansible/tmp/ansible-tmp-1680001664.0923839-130917866573098 `" ) && sleep 0'
<localhost> Attempting python interpreter discovery
<localhost> EXEC /bin/sh -c 'echo PLATFORM; uname; echo FOUND; command -v '"'"'/usr/bin/python'"'"'; command -v '"'"'python3.7'"'"'; command -v '"'"'python3.6'"'"'; command -v '"'"'python3.5'"'"'; command -v '"'"'python2.7'"'"'; command -v '"'"'python2.6'"'"'; command -v '"'"'/usr/libexec/platform-python'"'"'; command -v '"'"'/usr/bin/python3'"'"'; command -v '"'"'python'"'"'; echo ENDFOUND && sleep 0'
<localhost> EXEC /bin/sh -c '/usr/bin/python3 && sleep 0'
Using module file /usr/lib/python3/dist-packages/ansible/modules/system/setup.py
<localhost> PUT /root/.ansible/tmp/ansible-local-18385htcz16gz/tmp90cie041 TO /root/.ansible/tmp/ansible-tmp-1680001664.0923839-130917866573098/AnsiballZ_setup.py
<localhost> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1680001664.0923839-130917866573098/ /root/.ansible/tmp/ansible-tmp-1680001664.0923839-130917866573098/AnsiballZ_setup.py && sleep 0'
<localhost> EXEC /bin/sh -c '/usr/bin/python3 /root/.ansible/tmp/ansible-tmp-1680001664.0923839-130917866573098/AnsiballZ_setup.py && sleep 0'
<localhost> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1680001664.0923839-130917866573098/ > /dev/null 2>&1 && sleep 0'
ok: [localhost]

Changed in charm-elasticsearch:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.