mirror of
https://github.com/Expand-sys/awx-on-k3s
synced 2025-12-16 05:52:15 +11:00
feat: add guide to use additional modules or packages in ee
This commit is contained in:
parent
04cd9d6398
commit
6572841f4e
6 changed files with 43 additions and 5 deletions
|
|
@ -59,7 +59,7 @@ REPOSITORY TAG IMAGE ID CREAT
|
||||||
registry.example.com/ansible/ee 2.10-custom 6fb343319a80 2 minutes ago 871MB
|
registry.example.com/ansible/ee 2.10-custom 6fb343319a80 2 minutes ago 871MB
|
||||||
```
|
```
|
||||||
|
|
||||||
Now you can push this image to your [private container registry](../registry/README.md) to use as Execution Environment on AWX.
|
Now you can push this image to the container registry to use as Execution Environment on AWX. If you want to deploy your own private container registry, refer [additional guide on this repository](../registry).
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ docker push registry.example.com/ansible/ee:2.10-custom
|
$ docker push registry.example.com/ansible/ee:2.10-custom
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ sudo mkdir -p /data/git
|
||||||
|
|
||||||
### Deploy Private Git Repository
|
### Deploy Private Git Repository
|
||||||
|
|
||||||
Deploy Private Git Repository.
|
Deploy private Git repository.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
kubectl apply -k git
|
kubectl apply -k git
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ sudo mkdir -p /data/registry
|
||||||
|
|
||||||
### Deploy Private Container Registry
|
### Deploy Private Container Registry
|
||||||
|
|
||||||
Deploy Private Container Registry.
|
Deploy private container registry.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
kubectl apply -k registry
|
kubectl apply -k registry
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
If we don't have a DNS server and are using `/etc/hosts`, we will need to do some additional tasks to get the Pods on K3s to resolve names according to `/etc/hosts`.
|
If we don't have a DNS server and are using `/etc/hosts`, we will need to do some additional tasks to get the Pods on K3s to resolve names according to `/etc/hosts`.
|
||||||
|
|
||||||
This is necessary for AWX to resolve the hostname for your Private Git Repository or pull images from the Container Registry.
|
This is necessary for AWX to resolve the hostname for your private Git repository or pull images from the container registry.
|
||||||
|
|
||||||
One easy way to do this is to use `dnsmasq`.
|
One easy way to do this is to use `dnsmasq`.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -137,7 +137,7 @@ Now the redirection should be working. Go to `http://awx.example.com/` and make
|
||||||
|
|
||||||
## Enable redirects for other services in this repository
|
## Enable redirects for other services in this repository
|
||||||
|
|
||||||
You can also enable HTTPS redirection for [Git Repository](../git/), [Container Registry](../registry) and [Galaxy NG](../galaxy), which are included in this repository, by configuring Ingress as well.
|
You can also enable HTTPS redirection for [Git repository](../git/), [container registry](../registry) and [Galaxy NG](../galaxy), which are included in this repository, by configuring Ingress as well.
|
||||||
|
|
||||||
Add the following lines to the `ingress.yaml` for each resource,
|
Add the following lines to the `ingress.yaml` for each resource,
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ Some hints and guides for when you got stuck during deployment and daily use of
|
||||||
- [Troubles during Daily Use](#troubles-during-daily-use)
|
- [Troubles during Daily Use](#troubles-during-daily-use)
|
||||||
- [Job failed with no output](#job-failed-with-no-output)
|
- [Job failed with no output](#job-failed-with-no-output)
|
||||||
- [Provisioning Callback does not work](#provisioning-callback-does-not-work)
|
- [Provisioning Callback does not work](#provisioning-callback-does-not-work)
|
||||||
|
- [The job failed and I got "ERROR! couldn't resolve module/action" or "Failed to import the required Python library" message](#the-job-failed-and-i-got-error-couldnt-resolve-moduleaction-or-failed-to-import-the-required-python-library-message)
|
||||||
|
|
||||||
## Troubles during Deployment
|
## Troubles during Deployment
|
||||||
|
|
||||||
|
|
@ -327,3 +328,40 @@ kubectl -n awx logs -f deployments/awx-operator-controller-manager -c awx-manage
|
||||||
```
|
```
|
||||||
|
|
||||||
Now your Provisioning Callback should work. In my environment, the name of the host in the inventory have to be defined using IP address instead of DNS hostname.
|
Now your Provisioning Callback should work. In my environment, the name of the host in the inventory have to be defined using IP address instead of DNS hostname.
|
||||||
|
|
||||||
|
### The job failed and I got "ERROR! couldn't resolve module/action" or "Failed to import the required Python library" message
|
||||||
|
|
||||||
|
When you launch the Job Template, it may fail and you will see an error like the following:
|
||||||
|
|
||||||
|
```text
|
||||||
|
ERROR! couldn't resolve module/action 'community.postgresql.postgresql_info'. This often indicates a misspelling, missing collection, or incorrect module path.
|
||||||
|
|
||||||
|
The error appears to be in '/runner/project/site.yml': line 6, column 7, but may
|
||||||
|
be elsewhere in the file depending on the exact syntax problem.
|
||||||
|
|
||||||
|
The offending line appears to be:
|
||||||
|
tasks:
|
||||||
|
- community.postgresql.postgresql_info:
|
||||||
|
^ here
|
||||||
|
```
|
||||||
|
|
||||||
|
Alternatively, the import of Python modules may fail.
|
||||||
|
|
||||||
|
```text
|
||||||
|
...
|
||||||
|
TASK [community.postgresql.postgresql_info] ************************************
|
||||||
|
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Failed to import the required Python library (psycopg2) on automation-job-12-v2gvf's Python /usr/bin/python3. Please read the module documentation and install it in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter"}
|
||||||
|
...
|
||||||
|
```
|
||||||
|
|
||||||
|
When the Job Template launched at AWX, the playbook runs on the Execution Environment, which is a containerized environment completely isolated from the K3s host. The default Execution Environment has few typical collections, Pip modules, and RPM packages by default, but if your playbooks require additional (non-default) modules or packages, there are two ways to achieve this.
|
||||||
|
|
||||||
|
- **Place `collections/requirements.yml` in your project.**
|
||||||
|
- Note that this way is applicable for **adding Collections only**. If you want to add not only Collections but akso Pip modules or RPM Packages, follow the next method to build your own Execution Environment.
|
||||||
|
- You can create and place your own `collections/requirements.yml` including collections which you want to use. The format is the same as [the `requirements.yml` for ansible-galaxy](
|
||||||
|
https://docs.ansible.com/ansible/latest/galaxy/user_guide.html#install-multiple-collections-with-a-requirements-file).
|
||||||
|
- If `collections/requirements.yml` is present in your project, AWX will install the collections accordingly.
|
||||||
|
- **Build your own Execution Environment.**
|
||||||
|
- You can build your own Execution Environment. This method can be used for adding Collections, Pip modules and RPM packages.
|
||||||
|
- [There is a guide to use Ansible Builder on this repository](https://github.com/kurokobo/awx-on-k3s/tree/main/builder) to build Execution Environment. You can customize `requirements.yml` for Collections, `requirements.txt` for Pip modules, and `bindep.txt` for RPM packages.
|
||||||
|
- This method also requires Docker or Podman, and container registry. If you want to deploy your own private container registry on your K3s, refer [the guide on this repository](../registry).
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue