geerlingguy/ansible-vagrant-examples

Failing in "AWX installation Playbook"

jdhanasekar opened this issue · 5 comments

Hi All,

I like to use Ansible AWX for my Automation project instead of Ansible Tower
I have working on to install AWX Vagrant VM using this geerlingguy AWX example.
When I run vagrant up, I am getting below error,

task path: /home/user/dhanasekar/Automation/awx/roles/geerlingguy.awx/tasks/awx-install-playbook.yml:2
fatal: [awx]: FAILED! => {"changed": true, "cmd": ["ansible-playbook", "-i", "inventory", "install.yml", "-e", "postgres_data_dir=/var/lib/pgdocker"], 
"delta": "0:00:10.904668", "end": "2019-08-14 14:54:06.918634",
"msg": "non-zero return code", "rc": 2, "start": "2019-08-14 14:53:56.013966", 
"stderr": "[DEPRECATION WARNING]: The 'docker_service' module has been renamed to \n'docker_compose'..
 This feature will be removed in version 2.12. Deprecation \nwarnings can be disabled by setting deprecation_warnings=False in ansible.cfg.", 
"stderr_lines": ["[DEPRECATION WARNING]: The 'docker_service' module has been renamed to ", "'docker_compose'.. 
This feature will be removed in version 2.12. Deprecation ", "warnings can be disabled by setting deprecation_warnings=False in ansible.cfg."],
 "stdout": "\nPLAY [Build and deploy AWX] ****************************************************\n\n

Please help me to solve this issue.

Similar issue:

"fatal: [localhost]: FAILED! => {\"changed\": false, \"msg\": \"Unable to load docker-compose. Try `pip install docker-compose`. Error: Traceback (most recent call last):\\n  File \\\"/tmp/ansible_docker_service_payload_YgSgNB/__main__.py\\\", line 475, in <module>\\n    from compose import __version__ as compose_version\\nImportError: No module named compose\\n\"}"

In order to get docker-compose to correctly install via pip, i've needed to # yum install python-devel first.

As a follow up, here are some example tasks to outline the steps needed for me to get the awx role to work correctly on:

$ python --version
Python 3.7.4
$ uname -a
Darwin Mac-Pro 19.2.0 Darwin Kernel Version 19.2.0: Sat Nov  9 03:47:04 PST 2019; root:xnu-6153.61.1~20/RELEASE_X86_64 x86_64
$ vagrant version
Installed Version: 2.1.2
Latest Version: 2.2.7
$ ansible --version
ansible 2.8.6
[...]

Tasks here are explicit as needed for the sake of clarity. The latest zipp from pypi is broken on 2.7(or something) so I use the oldest version supported by docker-compose. The python headers are required to build the packages.

Lastly, these tasks were required to run after geerlingguy.nodejs and before geerlingguy.awx in my environment (centos/7 (virtualbox, 1804.02)).

---
- name: Install python headers
  package:
    name: python-devel
    state: present

- name: Install Development tools
  package:
    name: '@Development tools'

- name: Install python wheel
  pip:
    name: wheel

- name: Install zipp
  pip:
    name: zipp==0.5
    state: present

- name: Install docker-compose via pip
  pip:
    name: docker-compose

I can't vouch for my method's correctness but it has unblocked me.

stale commented

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

stale commented

This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.