Code Monkey home page Code Monkey logo

cog-teik-awx-custom-ee's Introduction

coe-teik-awx-custom-ee - an AWX execution environment

Source code to create a custom AWX execution environment with customized Python modules and Ansible collections.

Prepare python3 venv to setup ansible-builder

It is recommended to setup a virtual python environment to ensure it does not interfere with the local Python environment.

To setup a virtual environment ansible-builder run the following commands:

mkdir -p  ~/venv/ansible-builder
python3 -m venv ~/venv/ansible-builder
source ~/venv/ansible-builder/bin/activate

Install the required modules to build the execution environment

At first startup install some required modules in the venv:

pip3 install ansible-builder==3.0.0
pip3 uninstall --yes ansible-runner && pip3 install ansible-runner==2.3.3

Clone the git repository whose README.md you are reading

The execution environment is configured via the following files:

  • execution-environment.yml - this file contains the execution environment definition with the build instructions for the images being used to create the Dockerfile for the execution environment.
  • requirements.yml - this file lists the Ansible collections being installed in the execution environment
  • requirements.txt - this file lists the Python modules being installed in the execution environment
  • bindep.txt - This file lists the rpm packages being installed in the image
  • ansible.cfg - This file is optional and will be the default ansible.cfg for the execution environment

Build the Docker image with the execution environment

Build the image for the execution environment (make sure that the proper python env has been activated) by running:

ansible-builder build --tag <registry-host>/<registry-library>/<image>:<tag> --context ./context --container-runtime podman --file execution-environment.yml --prune-images --verbosity 3 --build-arg PKGMGR=/usr/bin/microdnf

for example:

ansible-builder build --tag localhost/hhue/cog-awx-custom-ee:0.0.1 --context ./context --container-runtime podman  --file execution-environment.yml --prune-images --verbosity 3 --build-arg PKGMGR=/usr/bin/microdnf

Retag and push the new image

The output of the ansible-builder command is a Docker image which is created locally. To use the image in AWX you need to

  • Tag the image for the Docker registry you are using
  • Push the image to your Docker registry

Sample execution environment definition in AWX

The following is a sample configuration of the execution environment in AWX:

cog-teik-awx-custom-ee

Useful links

https://github.com/ansible/awx

https://github.com/ansible/awx-operator

https://github.com/ansible/awx/blob/devel/INSTALL.md

https://github.com/ansible/awx/blob/devel/docs/execution_environments.md

https://www.linkedin.com/pulse/creating-custom-ee-awx-phil-griffiths

https://docs.ansible.com/automation-controller/latest/html/userguide/ee_reference.html

https://weiyentan.github.io/2021/creating-execution-environments/

cog-teik-awx-custom-ee's People

Contributors

hhue13 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.