# Custom EE with Azure modules?

**URL:** <https://forum.ansible.com/t/custom-ee-with-azure-modules/34953>\
**Category:** AWX Project\
**Tags:** azure, awx, ee\
**Created:** [April 9, 2021, 2:43pm UTC](https://forum.ansible.com/t/custom-ee-with-azure-modules/34953 "2021-04-09T14:43:58Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![howardjones](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/howardjones/32/4169_2.png) [@howardjones](https://forum.ansible.com/u/howardjones)\
**Post date:** [April 9, 2021, 2:43pm UTC](https://forum.ansible.com/t/custom-ee-with-azure-modules/34953/1 "2021-04-09T14:43:58Z")

</div>

I was hoping to try out AWX 19 this afternoon, specifically the execution environments, which might solve hassles we have with custom AWX builds and venvs currently, but...

I'm building an EE with collection.azcollection, and azure-cli inside it. So far pip has been running for about 2 hours trying to untangle the dependencies! Has anyone had any success with EEs for managing Azure resources?

---

<div class="post-metadata">

**Author:** ![Andrey\_Gangan](https://avatars.discourse-cdn.com/v4/letter/a/b19c9b/32.png) [@Andrey\_Gangan](https://forum.ansible.com/u/Andrey_Gangan)\
**Post date:** [April 10, 2021, 11:24am UTC](https://forum.ansible.com/t/custom-ee-with-azure-modules/34953/2 "2021-04-10T11:24:06Z")

</div>

do you want to add collection.azcollection to EE ?

I tryed to do same using requirments.yml placed in roles folder, but aws does not load them.

As a workaround I created /library and placed required modules there. it works.

[WegHostingZone - BigBlueButton Hosting, Linux support](https://www.webhostingzone.org/members/aff.php?aff=69)

пятница, 9 апреля 2021 г. в 17:44:00 UTC+3, Howard Jones:

---

<div class="post-metadata">

**Author:** ![howardjones](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/howardjones/32/4169_2.png) [@howardjones](https://forum.ansible.com/u/howardjones)\
**Post date:** [April 10, 2021, 12:50pm UTC](https://forum.ansible.com/t/custom-ee-with-azure-modules/34953/3 "2021-04-10T12:50:48Z")

</div>

Nearly. I want to add collection.azcollection \*and\* azure-cli to an EE. There are Azure functions (like creating a Service Principal) that you can't do with the azcollection modules yet.

I have been trying to use ansible-builder to build the EE, as they recommend, but pip basically runs forever trying to resolve the required versions (I stopped it after 24 hours).

I think I need to build two venvs inside the EE, since azcollection has very old versions of azure modules as dependencies.

---

<div class="post-metadata">

**Author:** ![Andrey\_Gangan](https://avatars.discourse-cdn.com/v4/letter/a/b19c9b/32.png) [@Andrey\_Gangan](https://forum.ansible.com/u/Andrey_Gangan)\
**Post date:** [April 10, 2021, 4:23pm UTC](https://forum.ansible.com/t/custom-ee-with-azure-modules/34953/4 "2021-04-10T16:23:53Z")

</div>

i did not checked about creating own env yet.  
The only needed was zabbix-api which I install on target machine and run zabbix as a remote module.

Anyway I gonna check it.

суббота, 10 апреля 2021 г. в 15:50:47 UTC+3, Howard Jones:

---

<div class="post-metadata">

**Author:** ![Andrey\_Gangan](https://avatars.discourse-cdn.com/v4/letter/a/b19c9b/32.png) [@Andrey\_Gangan](https://forum.ansible.com/u/Andrey_Gangan)\
**Post date:** [April 10, 2021, 4:40pm UTC](https://forum.ansible.com/t/custom-ee-with-azure-modules/34953/5 "2021-04-10T16:40:37Z")

</div>

did you check this link? :  
[https://github.com/ansible/awx-ee](https://github.com/ansible/awx-ee)

суббота, 10 апреля 2021 г. в 15:50:47 UTC+3, Howard Jones:

---

<div class="post-metadata">

**Author:** ![Andrey\_Gangan](https://avatars.discourse-cdn.com/v4/letter/a/b19c9b/32.png) [@Andrey\_Gangan](https://forum.ansible.com/u/Andrey_Gangan)\
**Post date:** [April 11, 2021, 1:50pm UTC](https://forum.ansible.com/t/custom-ee-with-azure-modules/34953/6 "2021-04-11T13:50:58Z")

</div>

Take a look here: [https://github.com/ansible/awx-ee/blob/devel/\_build/requirements.yml](https://github.com/ansible/awx-ee/blob/devel/_build/requirements.yml)  
It looks like your requirements alrady included.  
Did you try with the default EE ?

[WegHostingZone - BigBlueButton Hosting, Linux support](https://www.webhostingzone.org/members/aff.php?aff=69)

суббота, 10 апреля 2021 г. в 15:50:47 UTC+3, Howard Jones:

---

<div class="post-metadata">

**Author:** ![howardjones](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/howardjones/32/4169_2.png) [@howardjones](https://forum.ansible.com/u/howardjones)\
**Post date:** [April 12, 2021, 10:38am UTC](https://forum.ansible.com/t/custom-ee-with-azure-modules/34953/7 "2021-04-12T10:38:34Z")

</div>

It doesn't contain the Azure CLI ('az' command). That depends on the azure-cli-core, but is a separate module named azure-cli

azure-cli-core 2.11.1 is in the default awx-ee as a dependency of azure.azcollection, so in theory azure-cli==2.11.1 could work (the versions are tied together for azure-cli releases), BUT the other azure-mgmt-\* module dependencies are much newer even in that version. e.g: azure-mgmt-batch==9.0.0 in azure-cli, but 5.0.1 in azure.azcollection.

So I think it needs to be a separate venv for azure-cli inside the EE.

---

<div class="post-metadata">

**Author:** ![Andrey\_Gangan](https://avatars.discourse-cdn.com/v4/letter/a/b19c9b/32.png) [@Andrey\_Gangan](https://forum.ansible.com/u/Andrey_Gangan)\
**Post date:** [April 13, 2021, 10:27am UTC](https://forum.ansible.com/t/custom-ee-with-azure-modules/34953/8 "2021-04-13T10:27:05Z")

</div>

in this case I whould suggest to open ticket to add dependency in future releases.

понедельник, 12 апреля 2021 г. в 13:38:32 UTC+3, Howard Jones:

---

<div class="post-metadata">

**Author:** ![Wei-Yen\_Tan](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/wei-yen_tan/32/4111_2.png) [@Wei-Yen\_Tan](https://forum.ansible.com/u/Wei-Yen_Tan)\
**Post date:** [April 13, 2021, 10:32am UTC](https://forum.ansible.com/t/custom-ee-with-azure-modules/34953/9 "2021-04-13T10:32:49Z")

</div>

I am experimenting with building a custom container. I am a windows guy so I have tasks that I want to run with powershell. As a play I have included the steps to curl the Microsoft repository and yum it in the image. It compiles. So I am going to Upload and have a play 😊. It beats the previous example I had before

---

<div class="post-metadata">

**Author:** ![howardjones](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/howardjones/32/4169_2.png) [@howardjones](https://forum.ansible.com/u/howardjones)\
**Post date:** [April 13, 2021, 12:56pm UTC](https://forum.ansible.com/t/custom-ee-with-azure-modules/34953/10 "2021-04-13T12:56:02Z")

</div>

I started with the awx-ee repo, and updated the last few lines of the execution-environment.yml as follows to get helm, kubectl and the Azure 'az' cli tool into my EE. It seems like I need the latest (not released) ansible-runner to actually use it locally though (last release of ansible-runner with significant changes is actually a year old, and doesn't seem to mention docker anywhere).

version: 1  
dependencies:  
galaxy: \_build/requirements.yml  
system: \_build/bindep.txt  
additional\_build\_steps:  
append:  
- RUN alternatives --set python /usr/bin/python3  
- COPY --from=quay.io/project-receptor/receptor:0.9.7 /usr/bin/receptor /usr/bin/receptor  
- RUN mkdir -p /var/run/receptor  
- ADD run.sh /run.sh  
- CMD /run.sh  
- RUN pip install virtualenv  
- RUN virtualenv /opt/azure-cli  
- RUN /opt/azure-cli/bin/pip install azure-cli  
- RUN ln -s /opt/azure-cli/bin/az /usr/bin/az  
- RUN curl [https://get.helm.sh/helm-v3.5.3-linux-amd64.tar.gz](https://get.helm.sh/helm-v3.5.3-linux-amd64.tar.gz) | tar --strip-components=1 -C /usr/bin -xzf - linux-amd64/helm  
- RUN curl -L -o /usr/bin/kubectl [https://storage.googleapis.com/kubernetes-release/release/v1.20.5/bin/linux/amd64/kubectl](https://storage.googleapis.com/kubernetes-release/release/v1.20.5/bin/linux/amd64/kubectl) && chmod a+x /usr/bin/kubectl  
- USER 1000  
- RUN git lfs install

With that built, I can run playbooks with latest git ansible-runner and this runner/env/settings:

---

<div class="post-metadata">

**Author:** ![Wei-Yen\_Tan](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/wei-yen_tan/32/4111_2.png) [@Wei-Yen\_Tan](https://forum.ansible.com/u/Wei-Yen_Tan)\
**Post date:** [April 13, 2021, 1:03pm UTC](https://forum.ansible.com/t/custom-ee-with-azure-modules/34953/11 "2021-04-13T13:03:51Z")

</div>

Apologies. It looks like you are doing it through ansible builder? I realised that ansible-builder specialises in the python/ansible related stuff so I cloned the parent image (there is a repo for it) that it uses and customised that image using podman on centos /rhel 8. Now I have a base image with everything I need in it. You could do something similar?

---

<div class="post-metadata">

**Author:** ![Wei-Yen\_Tan](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/wei-yen_tan/32/4111_2.png) [@Wei-Yen\_Tan](https://forum.ansible.com/u/Wei-Yen_Tan)\
**Post date:** [April 13, 2021, 1:16pm UTC](https://forum.ansible.com/t/custom-ee-with-azure-modules/34953/12 "2021-04-13T13:16:49Z")

</div>

[ansible/awx-ee: An Ansible execution environment for AWX project (github.com)](https://github.com/ansible/awx-ee)

Here is the github repository.

I cloned this repository, made changes to the container file and then built it again. Then I will use ansible-builder to do the other ansible customization. Then I will upload this to my repo ie nexus.

Perhaps you can do something similar?

---

<div class="post-metadata">

**Author:** ![Wei-Yen\_Tan](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/wei-yen_tan/32/4111_2.png) [@Wei-Yen\_Tan](https://forum.ansible.com/u/Wei-Yen_Tan)\
**Post date:** [April 13, 2021, 1:24pm UTC](https://forum.ansible.com/t/custom-ee-with-azure-modules/34953/13 "2021-04-13T13:24:08Z")

</div>

Apologies Howard. Late in the night again,

I wonder if its a podman thing?
