# ansible version update in docker container(s)?

**URL:** <https://forum.ansible.com/t/ansible-version-update-in-docker-container-s/30497>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [June 5, 2019, 7:02pm UTC](https://forum.ansible.com/t/ansible-version-update-in-docker-container-s/30497 "2019-06-05T19:02:26Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Larry\_Bakun](https://avatars.discourse-cdn.com/v4/letter/l/41988e/32.png) [@Larry\_Bakun](https://forum.ansible.com/u/Larry_Bakun)\
**Post date:** [June 5, 2019, 7:02pm UTC](https://forum.ansible.com/t/ansible-version-update-in-docker-container-s/30497/1 "2019-06-05T19:02:26Z")

</div>

What is the right procedure to update ansible version in AWX running in the docker containers? What container to update? I’ve noticed that awx\_task and awx\_web containers both running ansible v2.7.9.  
Do I have to update ansible in both containers?

---

<div class="post-metadata">

**Author:** ![matburt](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/matburt/32/3612_2.png) [@matburt](https://forum.ansible.com/u/matburt)\
**Post date:** [June 5, 2019, 7:13pm UTC](https://forum.ansible.com/t/ansible-version-update-in-docker-container-s/30497/2 "2019-06-05T19:13:29Z")

</div>

This will get updated next time we make an AWX release, you can do it yourself by pulling it and updating them… you’ll need to point the installer at your new images wherever you host them.

---

<div class="post-metadata">

**Author:** ![Larry\_Bakun](https://avatars.discourse-cdn.com/v4/letter/l/41988e/32.png) [@Larry\_Bakun](https://forum.ansible.com/u/Larry_Bakun)\
**Post date:** [June 5, 2019, 7:31pm UTC](https://forum.ansible.com/t/ansible-version-update-in-docker-container-s/30497/3 "2019-06-05T19:31:02Z")

</div>

Hi Matthew,  
Unfortunately, there is no clear or safe way to upgrade from one AWX version to another and we stay on one version for about 6-12 month, and when we upgrade, we have to re-create everything manually. It takes time… At this moment I need new functionality from ansible 2.8.

---

<div class="post-metadata">

**Author:** ![Larry\_Bakun](https://avatars.discourse-cdn.com/v4/letter/l/41988e/32.png) [@Larry\_Bakun](https://forum.ansible.com/u/Larry_Bakun)\
**Post date:** [June 5, 2019, 8:37pm UTC](https://forum.ansible.com/t/ansible-version-update-in-docker-container-s/30497/4 "2019-06-05T20:37:29Z")

</div>

So, I went ahead and updated ansible version in the awx\_web container. Running tests now…

---

<div class="post-metadata">

**Author:** ![Larry\_Bakun](https://avatars.discourse-cdn.com/v4/letter/l/41988e/32.png) [@Larry\_Bakun](https://forum.ansible.com/u/Larry_Bakun)\
**Post date:** [June 5, 2019, 9:08pm UTC](https://forum.ansible.com/t/ansible-version-update-in-docker-container-s/30497/5 "2019-06-05T21:08:15Z")

</div>

UPDATE: after the update, even the “About” dialog shows ansible v2.8.0, the job log starts with ansible-playbook 2.7.9.  
…and if I update awx\_task container it breaks everything.  
I guess there is no easy way to update only ansible version without touching AWX itself…

---

<div class="post-metadata">

**Author:** ![kdelee](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kdelee/32/193_2.png) [@kdelee](https://forum.ansible.com/u/kdelee)\
**Post date:** [June 5, 2019, 9:17pm UTC](https://forum.ansible.com/t/ansible-version-update-in-docker-container-s/30497/6 "2019-06-05T21:17:10Z")

</div>

Have you considered creating your own custom virtual environment?

This can be used for inventory updates or job execution, and does not effect what version of ansible awx uses for other tasks.

[https://github.com/ansible/awx/blob/devel/docs/custom\_virtualenvs.md](https://github.com/ansible/awx/blob/devel/docs/custom_virtualenvs.md)

---

<div class="post-metadata">

**Author:** ![Larry\_Bakun](https://avatars.discourse-cdn.com/v4/letter/l/41988e/32.png) [@Larry\_Bakun](https://forum.ansible.com/u/Larry_Bakun)\
**Post date:** [June 5, 2019, 9:56pm UTC](https://forum.ansible.com/t/ansible-version-update-in-docker-container-s/30497/7 "2019-06-05T21:56:38Z")

</div>

Hi Elijah,  
No, I didn’t… that is a good idea I’ll try tomorrow.

---

<div class="post-metadata">

**Author:** ![Sujith\_A\_R1](https://avatars.discourse-cdn.com/v4/letter/s/c77e96/32.png) [@Sujith\_A\_R1](https://forum.ansible.com/u/Sujith_A_R1)\
**Post date:** [June 6, 2019, 1:59am UTC](https://forum.ansible.com/t/ansible-version-update-in-docker-container-s/30497/8 "2019-06-06T01:59:29Z")

</div>

Steps to follow awx\_web and awx\_task container to setup virtual env for ansible 2.X.X ( Replace 2.X.X with respective version number you want )

---

<div class="post-metadata">

**Author:** ![Larry\_Bakun](https://avatars.discourse-cdn.com/v4/letter/l/41988e/32.png) [@Larry\_Bakun](https://forum.ansible.com/u/Larry_Bakun)\
**Post date:** [June 6, 2019, 2:05pm UTC](https://forum.ansible.com/t/ansible-version-update-in-docker-container-s/30497/9 "2019-06-06T14:05:42Z")

</div>

Getting errors running this command:

/var/lib/awx/venv/ansible\_2.8.0/bin/pip install python-memcached psutil

Errors:

`

[root@awx venv]# /var/lib/awx/venv/ansible\_2.8.0/bin/pip install python-memcached psutil  
Collecting python-memcached  
Using cached [https://files.pythonhosted.org/packages/f5/90/19d3908048f70c120ec66a39e61b92c253e834e6e895cd104ce5e46cbe53/python\_memcached-1.59-py2.py3-none-any.whl](https://files.pythonhosted.org/packages/f5/90/19d3908048f70c120ec66a39e61b92c253e834e6e895cd104ce5e46cbe53/python_memcached-1.59-py2.py3-none-any.whl)  
Collecting psutil  
Using cached [https://files.pythonhosted.org/packages/c6/c1/beed5e4eaa1345901b595048fab1c85aee647ea0fc02d9e8bf9aceb81078/psutil-5.6.2.tar.gz](https://files.pythonhosted.org/packages/c6/c1/beed5e4eaa1345901b595048fab1c85aee647ea0fc02d9e8bf9aceb81078/psutil-5.6.2.tar.gz)  
Collecting six\>=1.4.0 (from python-memcached)  
Using cached [https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl](https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl)  
Building wheels for collected packages: psutil  
Building wheel for psutil (setup.py) … error  
ERROR: Complete output from command /var/lib/awx/venv/ansible\_2.8.0/bin/python36 -u -c ‘import setuptools, tokenize; **file** =’“'”‘/tmp/pip-install-9go6kp2j/psutil/setup.py’“'”‘;f=getattr(tokenize, ‘"’“‘open’”’“‘, open)( **file** );code=f.read().replace(’”‘"’\r\n’“'”‘, ‘"’"’\n’“'”‘);f.close();exec(compile(code, **file** , ‘"’“‘exec’”’"‘))’ bdist\_wheel -d /tmp/pip-wheel-ufytb431 --python-tag cp36:  
ERROR: running bdist\_wheel  
running build  
running build\_py  
creating build  
creating build/lib.linux-x86\_64-3.6  
creating build/lib.linux-x86\_64-3.6/psutil  
copying psutil/ **init**.py → build/lib.linux-x86\_64-3.6/psutil  
copying psutil/\_common.py → build/lib.linux-x86\_64-3.6/psutil  
copying psutil/\_compat.py → build/lib.linux-x86\_64-3.6/psutil  
copying psutil/\_psaix.py → build/lib.linux-x86\_64-3.6/psutil  
copying psutil/\_psbsd.py → build/lib.linux-x86\_64-3.6/psutil  
copying psutil/\_pslinux.py → build/lib.linux-x86\_64-3.6/psutil  
copying psutil/\_psosx.py → build/lib.linux-x86\_64-3.6/psutil  
copying psutil/\_psposix.py → build/lib.linux-x86\_64-3.6/psutil  
copying psutil/\_pssunos.py → build/lib.linux-x86\_64-3.6/psutil  
copying psutil/\_pswindows.py → build/lib.linux-x86\_64-3.6/psutil  
creating build/lib.linux-x86\_64-3.6/psutil/tests  
copying psutil/tests/ **init**.py → build/lib.linux-x86\_64-3.6/psutil/tests  
copying psutil/tests/ **main**.py → build/lib.linux-x86\_64-3.6/psutil/tests  
copying psutil/tests/runner.py → build/lib.linux-x86\_64-3.6/psutil/tests  
copying psutil/tests/test\_aix.py → build/lib.linux-x86\_64-3.6/psutil/tests  
copying psutil/tests/test\_bsd.py → build/lib.linux-x86\_64-3.6/psutil/tests  
copying psutil/tests/test\_connections.py → build/lib.linux-x86\_64-3.6/psutil/tests  
copying psutil/tests/test\_contracts.py → build/lib.linux-x86\_64-3.6/psutil/tests  
copying psutil/tests/test\_linux.py → build/lib.linux-x86\_64-3.6/psutil/tests  
copying psutil/tests/test\_memory\_leaks.py → build/lib.linux-x86\_64-3.6/psutil/tests  
copying psutil/tests/test\_misc.py → build/lib.linux-x86\_64-3.6/psutil/tests  
copying psutil/tests/test\_osx.py → build/lib.linux-x86\_64-3.6/psutil/tests  
copying psutil/tests/test\_posix.py → build/lib.linux-x86\_64-3.6/psutil/tests  
copying psutil/tests/test\_process.py → build/lib.linux-x86\_64-3.6/psutil/tests  
copying psutil/tests/test\_sunos.py → build/lib.linux-x86\_64-3.6/psutil/tests  
copying psutil/tests/test\_system.py → build/lib.linux-x86\_64-3.6/psutil/tests  
copying psutil/tests/test\_unicode.py → build/lib.linux-x86\_64-3.6/psutil/tests  
copying psutil/tests/test\_windows.py → build/lib.linux-x86\_64-3.6/psutil/tests  
running build\_ext  
building ‘psutil.\_psutil\_linux’ extension  
creating build/temp.linux-x86\_64-3.6  
creating build/temp.linux-x86\_64-3.6/psutil  
gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC\_ANNOTATIONS\_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D\_FORTIFY\_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D\_GNU\_SOURCE -fPIC -fwrapv -fPIC -DPSUTIL\_POSIX=1 -DPSUTIL\_VERSION=562 -DPSUTIL\_LINUX=1 -I/usr/include/python3.6m -c psutil/\_psutil\_common.c -o build/temp.linux-x86\_64-3.6/psutil/\_psutil\_common.o  
psutil/\_psutil\_common.c:9:20: fatal error: Python.h: No such file or directory  
#include \<Python.h\>  
^  
compilation terminated.  
error: command ‘gcc’ failed with exit status 1

---

<div class="post-metadata">

**Author:** ![rpetrell](https://avatars.discourse-cdn.com/v4/letter/r/b4bc9f/32.png) [@rpetrell](https://forum.ansible.com/u/rpetrell)\
**Post date:** [June 6, 2019, 2:12pm UTC](https://forum.ansible.com/t/ansible-version-update-in-docker-container-s/30497/10 "2019-06-06T14:12:36Z")

</div>

Larry,

psutil/\_psutil\_common.c:9:20: fatal error: Python.h: No such file or directory

You’re missing the libraries and header files needed to build psutil. You probably want something like (depending on your OS/distribution):

~ yum search python36-dev

python36-devel.x86\_64 : Libraries and header files needed for Python development \<-----

---

<div class="post-metadata">

**Author:** ![Sujith\_A\_R1](https://avatars.discourse-cdn.com/v4/letter/s/c77e96/32.png) [@Sujith\_A\_R1](https://forum.ansible.com/u/Sujith_A_R1)\
**Post date:** [June 6, 2019, 2:14pm UTC](https://forum.ansible.com/t/ansible-version-update-in-docker-container-s/30497/11 "2019-06-06T14:14:01Z")

</div>

Have you make sure that these packages are installed correctly on both containers?

yum install gcc python-devel

---

<div class="post-metadata">

**Author:** ![Larry\_Bakun](https://avatars.discourse-cdn.com/v4/letter/l/41988e/32.png) [@Larry\_Bakun](https://forum.ansible.com/u/Larry_Bakun)\
**Post date:** [June 6, 2019, 2:19pm UTC](https://forum.ansible.com/t/ansible-version-update-in-docker-container-s/30497/12 "2019-06-06T14:19:59Z")

</div>

`

Package gcc-4.8.5-36.el7\_6.2.x86\_64 already installed and latest version

Package python-devel-2.7.5-77.el7\_6.x86\_64 already installed and latest version

`

python version is 2.7.5… should I have python 3???

---

<div class="post-metadata">

**Author:** ![Sujith\_A\_R1](https://avatars.discourse-cdn.com/v4/letter/s/c77e96/32.png) [@Sujith\_A\_R1](https://forum.ansible.com/u/Sujith_A_R1)\
**Post date:** [June 6, 2019, 2:21pm UTC](https://forum.ansible.com/t/ansible-version-update-in-docker-container-s/30497/13 "2019-06-06T14:21:20Z")

</div>

Yes please . Kindly follow what Ryan had mentioned

---

<div class="post-metadata">

**Author:** ![Larry\_Bakun](https://avatars.discourse-cdn.com/v4/letter/l/41988e/32.png) [@Larry\_Bakun](https://forum.ansible.com/u/Larry_Bakun)\
**Post date:** [June 6, 2019, 2:36pm UTC](https://forum.ansible.com/t/ansible-version-update-in-docker-container-s/30497/14 "2019-06-06T14:36:48Z")

</div>

Here is what I’m getting when running _yum search python36-dev:_

`

[root@awx venv]# yum search python36-dev

Loaded plugins: fastestmirror, ovl

Loading mirror speeds from cached hostfile

- base: mirror.es.its.nyu.edu

- epel: [mirror.steadfastnet.com](http://mirror.steadfastnet.com)

- extras: mirror.es.its.nyu.edu

- updates: [mirror.fileplanet.com](http://mirror.fileplanet.com)

================================================================================== N/S matched: python36-dev ===================================================================================

boost- **python36-dev** el.x86\_64 : Shared object symbolic links for Boost.Python 3

**python36-dev** el.x86\_64 : Libraries and header files needed for Python development

shiboken- **python36-dev** el.x86\_64 : Development files for shiboken

Name and summary matches **only** , use “search all” for everything.

`

How do I get these?

---

<div class="post-metadata">

**Author:** ![kdelee](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kdelee/32/193_2.png) [@kdelee](https://forum.ansible.com/u/kdelee)\
**Post date:** [June 6, 2019, 2:39pm UTC](https://forum.ansible.com/t/ansible-version-update-in-docker-container-s/30497/15 "2019-06-06T14:39:00Z")

</div>

You need the libs/headers available to the whatever python interpreter you specified when you created /var/lib/awx/venv/ansible\_2.8.0/

So if you used a yum installed python36, you need to yum install the python36-devel package for the python36 interpreter.

---

<div class="post-metadata">

**Author:** ![Larry\_Bakun](https://avatars.discourse-cdn.com/v4/letter/l/41988e/32.png) [@Larry\_Bakun](https://forum.ansible.com/u/Larry_Bakun)\
**Post date:** [June 6, 2019, 3:01pm UTC](https://forum.ansible.com/t/ansible-version-update-in-docker-container-s/30497/16 "2019-06-06T15:01:29Z")

</div>

THANK YOU!!! I was missing “python36-devel.x86\_64” in both containers.

So, now everything is installed including ansible 2.8.0. Is there anything special I have to do in order to use a new module from 2.8.0 version? For example, I need to run “vmware\_export\_ovf” module. Sure I’ve tried:

`

ansible-playbook 2.7.9

2  
config file = /etc/ansible/ansible.cfg

3  
configured module search path = [u’/var/lib/awx/.ansible/plugins/modules’, u’/usr/share/ansible/plugins/modules’]

4  
ansible python module location = /usr/lib/python2.7/site-packages/ansible

5  
executable location = /usr/bin/ansible-playbook

6  
python version = 2.7.5 (default, Apr 9 2019, 14:30:50) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]

7  
Using /etc/ansible/ansible.cfg as config file

8  
SSH password:

9  
/tmp/awx\_1520\_u3wk2xic/tmpjbx7ym8\_ did not meet host\_list requirements, check plugin documentation if this is unexpected

10  
Parsed /tmp/awx\_1520\_u3wk2xic/tmpjbx7ym8\_ inventory source with script plugin

11  
ERROR! no action detected in task. This often indicates a misspelled module name, or incorrect module path.

12

13  
The error appears to have been in ‘/var/lib/awx/projects/vmMaintBackup/vmBackupDriver.yml’: line 11, column 5, but may

14  
be elsewhere in the file depending on the exact syntax problem.

15

16  
The offending line appears to be:

17

18

19

- name: Exporting data

20  
^ here

21

`

---

<div class="post-metadata">

**Author:** ![Larry\_Bakun](https://avatars.discourse-cdn.com/v4/letter/l/41988e/32.png) [@Larry\_Bakun](https://forum.ansible.com/u/Larry_Bakun)\
**Post date:** [June 6, 2019, 4:18pm UTC](https://forum.ansible.com/t/ansible-version-update-in-docker-container-s/30497/17 "2019-06-06T16:18:27Z")

</div>

Sujith,  
Is there anything else I have to do to get AWX to see new virtual env? I have installed ansible\_2.8.0, but still cannot run new module vmware\_export\_ovf

Regards,  
Larry

---

<div class="post-metadata">

**Author:** ![Sujith\_A\_R1](https://avatars.discourse-cdn.com/v4/letter/s/c77e96/32.png) [@Sujith\_A\_R1](https://forum.ansible.com/u/Sujith_A_R1)\
**Post date:** [June 6, 2019, 5:51pm UTC](https://forum.ansible.com/t/ansible-version-update-in-docker-container-s/30497/18 "2019-06-06T17:51:16Z")

</div>

Hi Larry,

You need to point the virtual environment either in job template or under the organization. Check this out :

[https://docs.ansible.com/ansible-tower/latest/html/upgrade-migration-guide/virtualenv.html#assigning-custom-virtualenvs](https://docs.ansible.com/ansible-tower/latest/html/upgrade-migration-guide/virtualenv.html#assigning-custom-virtualenvs)

Also, enable debug mode in job template then run and see whether it is calling the right version of Ansible

Regards,  
Sujith

---

<div class="post-metadata">

**Author:** ![Larry\_Bakun](https://avatars.discourse-cdn.com/v4/letter/l/41988e/32.png) [@Larry\_Bakun](https://forum.ansible.com/u/Larry_Bakun)\
**Post date:** [June 6, 2019, 7:29pm UTC](https://forum.ansible.com/t/ansible-version-update-in-docker-container-s/30497/19 "2019-06-06T19:29:48Z")

</div>

Thank you! After pointing to virtual env I had to install a couple more missing modules with pip. And it’s working now.

Thank you, everyone, for the help!

Regards,  
Larry

---

<div class="post-metadata">

**Author:** ![kdelee](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kdelee/32/193_2.png) [@kdelee](https://forum.ansible.com/u/kdelee)\
**Post date:** [June 7, 2019, 1:58pm UTC](https://forum.ansible.com/t/ansible-version-update-in-docker-container-s/30497/20 "2019-06-07T13:58:29Z")

</div>

Great to hear
