Last active
July 3, 2019 07:27
-
-
Save erbrito/809c130334d0a83d5e34c77855b5e9c8 to your computer and use it in GitHub Desktop.
Deploy of AWX (Ansible Tower) on OpenShift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir Tower | |
cd Tower/ | |
git clone https://github.com/ansible/awx.git | |
cd awx | |
cd installer/ | |
#vi inventory | |
-# openshift_host=127.0.0.1:8443 | |
-# awx_openshift_project=awx | |
-# openshift_user=developer | |
-# awx_node_port=30083 | |
+ openshift_host=127.0.0.1:8443 | |
+ awx_openshift_project=awx | |
+ openshift_user=developer | |
+ awx_node_port=30001 | |
+# valid host port range 30000-32767 | |
+ openshift_password=developer | |
# Standalone Docker Install | |
-postgres_data_dir=/tmp/pgdocker | |
-host_port=80 | |
+#postgres_data_dir=/tmp/pgdocker | |
+#host_port=80 | |
# Define if you want the image pushed to a registry. The container definition will also use these images | |
-# docker_registry=172.30.1.1:5000 | |
-# docker_registry_repository=awx | |
-# docker_registry_username=developer | |
+ docker_registry=172.30.1.1:5000 | |
+ docker_registry_repository=awx | |
+ docker_registry_username=developer | |
ansible-playbook -i inventory install.yml | |
#get the name of the AWX replica set | |
export RS_AWX = oc get rs|awk 'FNR>1 {print $1}' | |
oc scale --replicas=0 rs $RS_AWX | |
#add volume to the replicaset that will be mounted to awx-celery | |
oc patch rs $RS_AWX -p '{"spec":{"template":{"spec":{"volumes":[{"name":"awxprojectsdata","persistentVolumeClaim":{"claimName":"claim-awx"}}]}}}}' | |
#mount the volume to awx-celery | |
oc patch rs $RS_AWX -p '{"spec":{"template":{"spec":{"containers":[{"name":"awx-celery","volumeMounts":[{"mountPath":"/var/lib/awx/projects/","name":"awxprojectsdata"}]}]}}}}' | |
oc scale --replicas=1 rs $RS_AWX |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
TASK [kubernetes : OpenShift authentication failed on TLS verification] ******************************************************************
fatal: [localhost]: FAILED! => {"msg": "The conditional check 'openshift_auth_result.rc != 0' failed. The error was: error while evaluating conditional (openshift_auth_result.rc != 0): 'dict object' has no attribute 'rc'\n\nThe error appears to have been in '/Users/rtn361/Desktop/awx/installer/roles/kubernetes/tasks/openshift.yml': line 30, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: OpenShift authentication failed on TLS verification\n ^ here\n"}