Skip to main content

A credential plugin for AWX/AAP to authenticate with a GitHub App

Project description

AWX/AAP Crednetial Plugin for Github Apps

Was tested on AWX 23.5.1, but should work for newer versions with the plugin archtecture as both entry points are specified in the build.

Usage

With the continerized version of AWX doing installation of the external packages needs to be done at container build time. The best method of doing this is to wrap the task and web containers in your own Dockerfile and install this package.

For testing pruposes you can use minikube to install the package directly inside the container.

  1. Get the pod names for both task and web
$ kubectl get pods

NAME                                               READY   STATUS    RESTARTS   AGE
awx-demo-postgres-13-0                             1/1     Running   0          6h1m
awx-demo-task-6d856db85-8ph5s                      4/4     Running   0          4h45m
awx-demo-web-94554596f-d87k4                       3/3     Running   0          4h45m
awx-operator-controller-manager-6c5879f7c5-jcblw   2/2     Running   0          4h45m
  1. Get the container ID for the awx-demo-task (or whatever you named it) container
$ kubectl get pods awx-demo-task-6d856db85-8ph5s -o yaml

...
      readOnly: true
      recursiveReadOnly: Disabled
  - containerID: docker://0ba17fd042ef828c88573d20f19f4e51af85e913fe28afab1f04344a8142c7ea
    image: quay.io/ansible/awx:23.5.1
    imageID: docker-pullable://quay.io/ansible/awx@sha256:2d24fe9572852a1497c3c2514e6554cb4c6f01e9bfc775f5168ef53753f33248
    lastState: {}
    name: awx-demo-task
    ready: true
    restartCount: 0
...
  1. Get the container ID for the awx-demo-web (or whatever you named it) container
$ kubectl get pods awx-demo-web-94554596f-d87k4 -o yaml

...
      readOnly: true
      recursiveReadOnly: Disabled
  - containerID: docker://cbfcb587d00f64498f069ce4fe3358af14d545dc07e73fe88c5b87293e477cee
    image: quay.io/ansible/awx:23.5.1
    imageID: docker-pullable://quay.io/ansible/awx@sha256:2d24fe9572852a1497c3c2514e6554cb4c6f01e9bfc775f5168ef53753f33248
    lastState: {}
    name: awx-demo-web
    ready: true
    restartCount: 0
...
  1. SSH into the minikube box
$ minikube ssh
docker@minikube:~$ 
  1. Log into task container as root with the container ID
docker@minikube:~$ docker exec -it -u0 0ba17fd042ef828c88573d20f19f4e51af85e913fe28afab1f04344a8142c7ea /bin/bash
bash-5.1# 
  1. Install the credential plugin
bash-5.1# /var/lib/awx/venv/awx/bin/pip3 install -U awx-plugin-credential-github
...
  1. Log into task container as root with the container ID
docker@minikube:~$ docker exec -it -u0 cbfcb587d00f64498f069ce4fe3358af14d545dc07e73fe88c5b87293e477cee /bin/bash
bash-5.1# 
  1. Install the credential plugin
bash-5.1# /var/lib/awx/venv/awx/bin/pip3 install -U awx-plugin-credential-github
...
  1. Update AWX
bash-5.1# awx-manage setup_managed_credential_types
  1. Restart the task container
docker@minikube:~$ docker restart 0ba17fd042ef828c88573d20f19f4e51af85e913fe28afab1f04344a8142c7ea
  1. Restart the web contianer
docker@minikube:~$ docker restart cbfcb587d00f64498f069ce4fe3358af14d545dc07e73fe88c5b87293e477cee

You should now be able to use the plugin in AWX.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

awx_plugin_credential_github-1.0.0.tar.gz (30.5 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file awx_plugin_credential_github-1.0.0.tar.gz.

File metadata

File hashes

Hashes for awx_plugin_credential_github-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d6e22f5540c53ce69b8bb070ec14b355ab512b7477c2bd9c5111575bc16000c3
MD5 6a67a71d418fcd3bad3b240966e8bb6b
BLAKE2b-256 325db1a3a4b8d021c9b98e7d01e53e843d2c31c5377c352914b1fec3d13c6514

See more details on using hashes here.

File details

Details for the file awx_plugin_credential_github-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for awx_plugin_credential_github-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c4c2341065374edc3061651d95291b2ea3f37b63a72eb3c0e32ce83e13efee39
MD5 d756065433a9faa2c8bcf89607be6c3a
BLAKE2b-256 cfadde1c990f6981562876a7c5b6f5dd276a36c92d9cc4e5ee7b7572cc328579

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page