I am new to AWX and just tried to install in a docker EC2 instance on AWS. When I tried to build AWX as mentioned in the GitHub page, I received the below error:
[ec2-user@ip-172-31-4x-xxx awx]$ cd installer/
[ec2-user@ip-172-31-4x-xxx installer]$ ansible-playbook -i inventory install.yml
ERROR! no action detected in task. This often indicates a misspelled module name, or incorrect module path.
The error appears to have been in '/home/ec2-user/awx/installer/check_vars/tasks/main.yml': line 3, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
The error appears to have been in '/home/ec2-user/awx/installer/check_vars/tasks/main.yml': line 3, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
I quickly looked into this document, but couldn't find anything wrong there with the syntax, in fact I haven't opened that file before. Can someone please help me resolving this issue soon? Thanks
I had this issue on a RHEL6 box that was on Ansible 2.3, AWX Technically requires 2.4+ which has a slightly updated syntax to 2.3, If you can only use 2.3 and cannot upgrade edit that file and change it to the previous syntax.
From memory i think it was just 'include:' rather than 'include_tasks:'
But keep in mind Ansible 2.3 isn't actually supported, You should include the questions it asks you when you create an issue such as Ansible and OS versions in your initial post
That worked, thanks. But the installation is now completed and when I check the localhost, it is showing AWX is upgrading. I believe this is because of the DB migration, but how long it could take? Its been like almost an hour I am facing the same screen, even if I reload the page. May I restart the EC2 instance, would that work in any way?
The upgrading part has never taken more than 10 minutes for me
Check the logs (docker logs _containerid_) of the various containers mainly the 2 AWX ones and the Postgresql one
Also in regards to restarting the AWX instance, I doubt it would be a good idea to restart it in the middle of it upgrading, but i've never tried. May work fine, may end up needing to be wiped so it can start the process again.
Best to find why it is stuck first
But I don't get to see anything when I do docker logs -f container-name, after maybe 10 minutes of time. It looks like the system is very slow, but not sure. Only once I was able to see that there are 5 containers running when I executed docker ps. My EC2 instance size is 1CPU with 1 GB ram and 30 GB SSD, would this be sufficient? Or is there any specific specs required?
That is very low spec,
Unfortunately the INSTALL.md in this GitHub isn't very clear on a lot of things but you can check the tower requirements here: http://docs.ansible.com/ansible-tower/2.2.2/html/installandreference/requirements_refguide.html
There's a good chance that's whats causing the containers to hang
I would recommend trying AWX out on an instance that meets all the requirements
Ansible 2.4+
2CPU
4GB RAM
64bit OS like CentOS7 or similar
Okay, so this is the new instance which I created just now. The same has been configured with docker-py, make, git and i have checkedout ansible 2.4 from git. Now when I try to do
make install (with sudo as well), I am getting an error like this:
Installed /usr/local/lib/python2.7/site-packages/ansible-2.4.2.0-py2.7.egg
Processing dependencies for ansible==2.4.2.0
Searching for cryptography
Reading https://pypi.python.org/simple/cryptography/
Downloading https://pypi.python.org/packages/f3/7c/ec4f94489719803cb14d35e9625d1f5a613b9c4b8d01ee52a4c77485e681/cryptography-2.1.3.tar.gz#md5=65c0963048a88fcf725cfa265ed2fd5c
Best match: cryptography 2.1.3
Processing cryptography-2.1.3.tar.gz
Writing /tmp/easy_install-lWAPH8/cryptography-2.1.3/setup.cfg
Running cryptography-2.1.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-lWAPH8/cryptography-2.1.3/egg-dist-tmp-4wyDf7
c/_cffi_backend.c:2:20: fatal error: Python.h: No such file or directory
#include <Python.h>
^
compilation terminated.
error: Setup script exited with error: command 'gcc' failed with exit status 1
make: *** [install] Error 1
Ansible is not installed, i verified by checking the version number. Any solution for this?
Update: I have installed gcc as well as installed python-devel which now in version 2.7
What OS are you using? Is it possible to get Ansible 2.4 from a repo with yum or apt?
I believe I am using Amazon Linux, which is CentOS based. I am not sure if I can get it using yum, yesterday I tried to get it from epel, but version 2.4 didnt get installed. But is there a way I can get this specific version for Ansible from EPEL repos?
Ah right unfortunately I haven't used Amazon Linux, I just installed off of the RHEL7 Repos using yum. Best option would be to try googling your issue.
do you have python-dev installed?
Ok.. This is an update:
I installed Ansible from yum as you mentioned by making use of epel. This was the command I used and it gave me output Ansible 2.4 is installed.
`sudo yum install ansible-2.4.1.0-2.el6
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
Importing GPG key 0x0608B895:
Userid : "EPEL (6) epel@fedoraproject.org"
Fingerprint: 8c3b e96a f230 9184 da5c 0dae 3b49 df2a 0608 b895
Package : epel-release-6-8.9.amzn1.noarch (@amzn-main)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : python26-crypto-2.6.1-1.14.amzn1.x86_64 1/18
Installing : python26-six-1.8.0-1.23.amzn1.noarch 2/18
Installing : python26-ecdsa-0.11-3.3.amzn1.noarch 3/18
Installing : python26-paramiko-1.15.1-1.5.amzn1.noarch 4/18
Installing : python26-simplejson-3.6.5-1.12.amzn1.x86_64 5/18
Installing : python26-markupsafe-0.11-4.6.amzn1.x86_64 6/18
Installing : python26-pyasn1-0.1.7-2.9.amzn1.noarch 7/18
Installing : python-keyczar-0.71c-1.el6.noarch 8/18
Installing : python26-backports-1.0-3.14.amzn1.x86_64 9/18
Installing : python26-backports-ssl_match_hostname-3.4.0.2-1.12.amzn1 10/18
Installing : python26-setuptools-36.2.7-1.33.amzn1.noarch 11/18
Installing : python26-babel-0.9.4-5.1.8.amzn1.noarch 12/18
Installing : python-jinja2-26-2.6-3.el6.noarch 13/18
Installing : python-crypto2.6-2.6.1-2.el6.x86_64 14/18
Installing : python26-httplib2-0.7.7-1.5.amzn1.noarch 15/18
Installing : python26-PyYAML-3.10-3.10.amzn1.x86_64 16/18
Installing : sshpass-1.06-1.el6.x86_64 17/18
Installing : ansible-2.4.1.0-2.el6.noarch 18/18
Verifying : python26-setuptools-36.2.7-1.33.amzn1.noarch 1/18
Verifying : python26-paramiko-1.15.1-1.5.amzn1.noarch 2/18
Verifying : sshpass-1.06-1.el6.x86_64 3/18
Verifying : python-keyczar-0.71c-1.el6.noarch 4/18
Verifying : python26-babel-0.9.4-5.1.8.amzn1.noarch 5/18
Verifying : python-jinja2-26-2.6-3.el6.noarch 6/18
Verifying : python26-PyYAML-3.10-3.10.amzn1.x86_64 7/18
Verifying : python26-backports-ssl_match_hostname-3.4.0.2-1.12.amzn1 8/18
Verifying : ansible-2.4.1.0-2.el6.noarch 9/18
Verifying : python26-six-1.8.0-1.23.amzn1.noarch 10/18
Verifying : python26-ecdsa-0.11-3.3.amzn1.noarch 11/18
Verifying : python26-httplib2-0.7.7-1.5.amzn1.noarch 12/18
Verifying : python-crypto2.6-2.6.1-2.el6.x86_64 13/18
Verifying : python26-backports-1.0-3.14.amzn1.x86_64 14/18
Verifying : python26-pyasn1-0.1.7-2.9.amzn1.noarch 15/18
Verifying : python26-crypto-2.6.1-1.14.amzn1.x86_64 16/18
Verifying : python26-markupsafe-0.11-4.6.amzn1.x86_64 17/18
Verifying : python26-simplejson-3.6.5-1.12.amzn1.x86_64 18/18
Installed:
ansible.noarch 0:2.4.1.0-2.el6 `
But again when I try to get ansible version (ansible --version) it throws me this error:
[ec2-user@ip-172-31-xx-x6 ~]$ ansible --version
Traceback (most recent call last):
File "/usr/local/bin/ansible", line 4, in <module>
__import__('pkg_resources').run_script('ansible==2.4.2.0', 'ansible')
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3049, in <module>
@_call_aside
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3033, in _call_aside
f(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3062, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 658, in _build_master
ws.require(__requires__)
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 972, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 858, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'cryptography' distribution was not found and is required by ansible
By the looks of things (Referring to EPEL6 repo) your OS is based off Centos6, I upgraded to 7 from 6 as 6 wouldn't let me install the newest versions of docker and ansible.
I don't really know much about running off amazon linux so hopefully someone else can help
Ok, tell me this: Is this error because of that I messed up with the cryptographic things before by trying make install?
Is there any possibility for that?
I'm not sure at all, I don't really understand the full process of the way of installing, googling the last line of that error got me this:
https://github.com/ansible/ansible/issues/15565
the last comment looks hopefull
You're really awesome :) That worked. Installed ansible 2.4 and started the containers. Waiting for the migration and further config to be done, fingers crossed.. Thanks a lot.
Most helpful comment
I had this issue on a RHEL6 box that was on Ansible 2.3, AWX Technically requires 2.4+ which has a slightly updated syntax to 2.3, If you can only use 2.3 and cannot upgrade edit that file and change it to the previous syntax.
From memory i think it was just 'include:' rather than 'include_tasks:'
But keep in mind Ansible 2.3 isn't actually supported, You should include the questions it asks you when you create an issue such as Ansible and OS versions in your initial post