Issue #5: Initial testing with Ansible Tower images instead of AWX.

This commit is contained in:
Jeff Geerling
2019-11-11 14:10:50 -06:00
parent 65546b42e6
commit a912a256d1
4 changed files with 53 additions and 6 deletions

View File

@@ -4,6 +4,35 @@
An [Ansible Tower](https://www.ansible.com/products/tower) operator for Kubernetes built with [Operator SDK](https://github.com/operator-framework/operator-sdk) and Ansible.
## Purpose
There are already OpenShift/Kubernetes installers available for both AWX and Ansible Tower:
- [AWX on Kubernetes](https://github.com/ansible/awx/blob/devel/INSTALL.md#kubernetes)
- [Ansible Tower on Kubernetes](https://docs.ansible.com/ansible-tower/latest/html/administration/openshift_configuration.html)
This operator is meant to provide a more Kubernetes-native installation method for Ansible Tower or AWX via a Tower Custom Resource Definition (CRD).
So instead of having to maintain a separate playbook, inventory, and installation configuration for each Tower instance, you can deploy the following Custom Resource (CR) to an existing Kubernetes or OpenShift cluster:
apiVersion: tower.ansible.com/v1alpha1
kind: Tower
metadata:
name: tower
namespace: ansible-tower
spec:
tower_hostname: tower.mycompany.com
tower_secret_key: aabbcc
tower_admin_user: test
tower_admin_password: changeme
After a few minutes, your new Tower instance will be accessible at `http://tower.mycompany.com/` (assuming your cluster has an Ingress controller configured).
## Usage
TODO: See [Issue #4](https://github.com/geerlingguy/tower-operator/issues/4).
## Testing
This Operator includes a [Molecule](https://molecule.readthedocs.io/en/stable/)-based test environment, which can be executed standalone in Docker (e.g. in CI or in a single Docker container anywhere), or inside any kind of Kubernetes cluster (e.g. Minikube).

View File

@@ -6,12 +6,22 @@ metadata:
spec:
tower_hostname: example-tower.test
tower_secret_key: aabbcc
tower_admin_user: test
tower_admin_password: changeme
tower_task_image: ansible/awx_task:9.0.1
tower_web_image: ansible/awx_web:9.0.1
# Use these for Ansible Tower.
tower_task_image: registry.access.redhat.com/ansible-tower-35/ansible-tower:3.5.3
tower_web_image: registry.access.redhat.com/ansible-tower-35/ansible-tower:3.5.3
# Use these for Ansible AWX.
# tower_task_image: ansible/awx_task:9.0.1
# tower_web_image: ansible/awx_web:9.0.1
tower_memcached_image: memcached:alpine
tower_rabbitmq_image: rabbitmq:3
tower_postgres_pass: awxpass
tower_postgres_image: postgres:9.6
tower_postgres_storage_request: 8Gi

View File

@@ -1,12 +1,22 @@
---
tower_hostname: example-tower.test
tower_secret_key: aabbcc
tower_admin_user: test
tower_admin_password: changeme
tower_task_image: ansible/awx_task:9.0.1
tower_web_image: ansible/awx_web:9.0.1
# Use these image versions for Ansible Tower.
tower_task_image: registry.access.redhat.com/ansible-tower-35/ansible-tower:3.5.3
tower_web_image: registry.access.redhat.com/ansible-tower-35/ansible-tower:3.5.3
# Use these image versions for Ansible AWX.
# tower_task_image: ansible/awx_task:9.0.1
# tower_web_image: ansible/awx_web:9.0.1
tower_memcached_image: memcached:alpine
tower_rabbitmq_image: rabbitmq:3
tower_postgres_pass: awxpass
tower_postgres_image: postgres:9.6
tower_postgres_storage_request: 8Gi

View File

@@ -18,8 +18,6 @@ data:
MEMCACHED_PORT='11211'
RABBITMQ_HOST='{{ meta.name }}-rabbitmq.{{ meta.namespace }}.svc.cluster.local'
RABBITMQ_PORT='5672'
AWX_ADMIN_USER={{ tower_admin_user }}
AWX_ADMIN_PASSWORD={{ tower_admin_password | quote }}
settings: |
import os