Custom EE in Ansible 19 fails

1,540 views
Skip to first unread message

Banshee091

unread,
Apr 8, 2021, 11:18:55 AM4/8/21
to AWX Project

Hey there,
I wanted to make sure I don't overlook something, before I open a bug report.

I created a custom EE for AWX 18, since installing collections didn't work properly there.
It worked absolutely fine, when I set it as an image in the instance group  --> customize pod settings.
Now, with a brand new awx 19 installation, installing collections and roles workes absolutely fine, but when I try to use the same EE (with and without setting it in the instance group) the playbook fails instantly with the following error:

2021-04-08 15:00:15,229 ERROR    [4a0369353c4f4fdbb45f873938b5f6a3] awx.main.tasks job 27 (running) Exception occurred while running task
Traceback (most recent call last):
  File "/var/lib/awx/venv/awx/lib64/python3.8/site-packages/awx/main/tasks.py", line 1397, in run
    res = receptor_job.run()
  File "/var/lib/awx/venv/awx/lib64/python3.8/site-packages/awx/main/tasks.py", line 2957, in run
    return self._run_internal(receptor_ctl)
  File "/var/lib/awx/venv/awx/lib64/python3.8/site-packages/awx/main/tasks.py", line 3008, in _run_internal
    raise RuntimeError(detail)
RuntimeError: Error creating pod: container failed with exit code 1:

Anyone any ideas?

Shane McDonald

unread,
Apr 8, 2021, 12:49:21 PM4/8/21
to Banshee091, AWX Project
Did you customize your pod definition when you were on AWX 18? We made a small tweak. You’ll need to reset to the default value and build on top of that. Sorry for the confusion.

--
You received this message because you are subscribed to the Google Groups "AWX Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to awx-project...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/awx-project/5ba5d17c-25a4-4599-863c-80688d47ec18n%40googlegroups.com.

Banshee091

unread,
Apr 8, 2021, 12:55:19 PM4/8/21
to AWX Project
Unfortunately, I was not able to upgrade from AWX 18 (Tbh, I still don't know why, but I might messed up the minikube enviroment). The setup in question is completely new. Is it neccessary to add the custom ee as specs while deploying?
Thanks for the answer :)

Banshee091

unread,
Apr 9, 2021, 10:37:20 AM4/9/21
to AWX Project
Okay, I don't know if anybody has the same problem, but I was able to find a workaround. Though I really would love if someone more capable than me, would be able to explain to me what I was missing while building the custom ee.
The problem is propably, that I'm missing some crucial dependencies while building my own ee, though I don't know which.
If some should be struggeling with the same error: I cloned the github repo of the awx-ee project and appended the python modules which weren't included in the already deployed ee.


Anyway: Thanks to the maintainers of the awx-ee-repo, I hope it is okay for me to take your code and build on it...and if someone knows  where I might missed something... feel free to contact me.


Happy hacking

Pluppo

unread,
Apr 15, 2021, 9:48:59 AM4/15/21
to AWX Project
I'm having exactly the same problem in AWX 19.0.0 (running with minikube) when trying to use an execution environment that I made using ansible-builder.

Traceback (most recent call last):
    File "/var/lib/awx/venv/awx/lib64/python3.8/site-packages/awx/main/tasks.py", line 1397, in run res = receptor_job.run()
    File "/var/lib/awx/venv/awx/lib64/python3.8/site-packages/awx/main/tasks.py", line 2957, in run return self._run_internal(receptor_ctl)
    File "/var/lib/awx/venv/awx/lib64/python3.8/site-packages/awx/main/tasks.py", line 3008, in _run_internal raise RuntimeError(detail) RuntimeError: Error creating pod: container failed with exit code 1:

Cloning the awx-ee repo and adding the collections and python modules I needed worked, but now I have much more stuff in the image than what I wanted. I had no experience with Docker or Kubernetes before having to install AWX, so this is a really steep learning curve for me.

I wish someone could do an example installation of an execution environment with custom collections and Python modules that works with AWX 19.0.0 and write a blog about it.

Andrea Lenarduzzi

unread,
Apr 15, 2021, 9:51:32 AM4/15/21
to AWX Project
Hi, me too!!!!
"I wish someone could do an example installation of an execution environment with custom collections and Python modules that works with AWX 19.0.0 and write a blog about it."


--
Le informazioni, i dati e le notizie contenute nella presente comunicazione e i relativi allegati sono di natura privata e come tali possono essere riservate e sono, comunque, destinate esclusivamente ai destinatari indicati in epigrafe. La diffusione, distribuzione e/o la copiatura del documento trasmesso da parte di qualsiasi soggetto diverso dal destinatario è proibita, sia ai sensi dell'art. 616 c.p., sia ai sensi del D.Lgs. n. 196/2003. Se avete ricevuto questo messaggio per errore, vi preghiamo di distruggerlo e di darcene immediata comunicazione anche inviando un messaggio di ritorno all'indirizzo e-mail del mittente.

This e-mail (including attachments) is intended only for the recipient(s) named above. It may contain confidential or privileged information and should not be read, copied or otherwise used by any other person. If you are not the named recipient, please contact (specificare l'e-mail dell'azienda) and delete the e-mail from your system. Rif. D.L. 196/2003.

Christopher Meyers

unread,
Apr 15, 2021, 9:53:20 AM4/15/21
to Andrea Lenarduzzi, AWX Project

Pluppo

unread,
Apr 15, 2021, 10:18:53 AM4/15/21
to AWX Project
That's a nice blog, I had already studied it when trying to understand how ansible-builder works. But it's missing a working example of how to get the execution environment working in AWX 19 without getting the "RuntimeError: Error creating pod: container failed with exit code 1:" error.

The only way I was able to use an execution environment in AWX 19 was to clone the https://github.com/ansible/awx-ee repo and add the collections and Python modules that I needed. But this adds a lot of unneeded collections and Python modules to the environment.

Andrea Lenarduzzi

unread,
Apr 15, 2021, 10:46:37 AM4/15/21
to Pluppo, AWX Project
Hi, Please can you tell me details about how "The only way I was able to use an execution environment in AWX 19 was to clone the https://github.com/ansible/awx-ee repo and add the collections and Python modules that I needed. But this adds a lot of unneeded collections and Python modules to the environment." ?

Thank you

Pluppo

unread,
Apr 15, 2021, 11:00:27 AM4/15/21
to AWX Project
Sure, here are the steps:
cd awx-ee
vim _build/requirements.yml    # I just added the collections I needed at the bottom of this file
vim _build/requirements.txt      # This file is new, contains the Python modules I need
vim execution-environment.yml  # I added "python: _build/requirements.txt" under dependencies
cp run.sh _build/run.sh
cp run.sh context/run.sh  # ansible-builder was complaining about run.sh missing, so I copied it to both the _build and the context folders (not sure which one is needed)
ansible-builder build --tag myuser/mytag --verbosity 3

I was then able to push the image to Docker Hub and specify that an Execution Environment in AWX 19.

phil.gr...@gmail.com

unread,
Apr 16, 2021, 10:53:44 AM4/16/21
to AWX Project
"I wish someone could do an example installation of an execution environment with custom collections and Python modules that works with AWX 19.0.0 and write a blog about it."
^^^ That a starter for ten!

Andrea Lenarduzzi

unread,
Apr 16, 2021, 12:46:10 PM4/16/21
to phil.gr...@gmail.com, AWX Project
Ok, than How can I add my_first_ee_image in AWX 19?
Thank you

Wei-Yen Tan

unread,
Apr 16, 2021, 1:24:18 PM4/16/21
to Andrea Lenarduzzi, phil.gr...@gmail.com, AWX Project
It is a container at this point so you would push that into a repository like nexus /artifactory and then in awx there is an option under administration execution environments to add in the image 


From: awx-p...@googlegroups.com <awx-p...@googlegroups.com> on behalf of Andrea Lenarduzzi <andre...@gmail.com>
Sent: Saturday, April 17, 2021 4:45:57 AM
To: phil.gr...@gmail.com <phil.gr...@gmail.com>; AWX Project <awx-p...@googlegroups.com>
Subject: Re: [awx-project] Custom EE in Ansible 19 fails
 

Phil Griffiths

unread,
Apr 16, 2021, 2:08:40 PM4/16/21
to Andrea Lenarduzzi, AWX Project
Ok, I've got something working but I need to track back exactly what I did! 
Check you are running the latest devel release of ansible-builder which at time of writing is 1.0.0.0a1
If you just pip install ansible-runner you only get 0.6.0 which appears broken.

I'll try to recreate a working example and post something either here or LinkedIn

Andrea Lenarduzzi

unread,
Apr 16, 2021, 3:23:58 PM4/16/21
to AWX Project
Ok, can you suggeat me a free on premise repository solution?

Thank you

Wei-Yen Tan

unread,
Apr 16, 2021, 3:31:03 PM4/16/21
to Andrea Lenarduzzi, AWX Project
OS's Nexus is free and fully featured 


Sent: Saturday, April 17, 2021 7:23:45 AM
To: AWX Project <awx-p...@googlegroups.com>

Phil Griffiths

unread,
Apr 16, 2021, 4:48:47 PM4/16/21
to Andrea Lenarduzzi, AWX Project
Checkout: https://www.linkedin.com/pulse/creating-custom-ee-awx-phil-griffiths
It's still early days for EE's in AWX but it does work :)

Mathias Homann

unread,
Apr 16, 2021, 5:42:19 PM4/16/21
to awx-p...@googlegroups.com
Am Freitag, 16. April 2021, 20:08:02 CEST schrieb Phil Griffiths:
> Ok, I've got something working but I need to track back exactly what I did!
> Check you are running the latest devel release of ansible-builder which at
> time of writing is 1.0.0.0a1
> If you just pip install ansible-runner you only get 0.6.0 which appears
> broken.


this did it for me:
pip3 install ansible-builder==1.0.0.0a1

Cheers
MH

--
Mathias Homann
Mathias...@openSUSE.org
Jabber (XMPP): le...@tuxonline.tech
IRC: [Lemmy] on freenode and ircnet (bouncer active)
telegram: https://telegram.me/lemmy98
keybase: https://keybase.io/lemmy
gpg key fingerprint: 8029 2240 F4DD 7776 E7D2 C042 6B8E 029E 13F2 C102


Reply all
Reply to author
Forward
0 new messages