| | |
| | | set_fact: |
| | | nodejs_ocp_project: "nodejs-{{lab_name}}-{{guid}}" |
| | | |
| | | - name: define OCP Project for 3scale Gateway |
| | | set_fact: |
| | | 3scalegw_ocp_project: "{{ocp_username}}-gw-{{lab_name}}-{{guid}}" |
| | | |
| | | - name: define OCP Project for 3scale MT |
| | | set_fact: |
| | | 3scalemt_ocp_project: "3scale-mt-{{lab_name}}-{{guid}}" |
| | | |
| | | # ####### End of Project Definitions ############## # |
| | | |
| | | # ####### Start of Installation of ephemeral RHSSO ############## # |
| | |
| | | command: "oc label namespace {{rhsso_ocp_project}} AAD='{{guid}}'" |
| | | when: rhsso_project_result is failed |
| | | |
| | | - name: Make sure we go back to the default project |
| | | shell: "oc project default" |
| | | - name: "Make sure we go back to project {{rhsso_ocp_project}}" |
| | | shell: "oc project {{rhsso_ocp_project}}" |
| | | when: rhsso_project_result is failed |
| | | |
| | | - name: Create SSO Service Account |
| | | shell: "oc create serviceaccount sso-service-account" |
| | | when: rhsso_project_result is failed |
| | | |
| | | - name: Give service account access to Lab Infra project |
| | | shell: "oc policy add-role-to-user view system:serviceaccount:{{ocp_username}}-sso:sso-service-account" |
| | | when: rhsso_project_result is failed |
| | | |
| | | - name: Create ephemeral RHSSO template |
| | | shell: "oc create -f {{rhsso_template_yml}} -n {{rhsso_ocp_project}}" |
| | | when: rhsso_project_result is failed |
| | | |
| | | - name: Create ephemeral RHSSO app |
| | | shell: "oc new-app --template=sso72-x509-https --param HOSTNAME_HTTP={{ocp_username}}-sso-unsecured.{{$OCP_SUFFIX}} --param HOSTNAME_HTTPS={{ocp_username}}-sso.{{$OCP_SUFFIX}} --param SSO_ADMIN_USERNAME=admin --param SSO_ADMIN_PASSWORD=password --param SSO_SERVICE_USERNAME=admin --param SSO_SERVICE_PASSWORD=password --param SSO_REALM=3scaleRealm -n {{rhsso_ocp_project}}" |
| | | when: rhsso_project_result is failed |
| | | |
| | | # ####### End of Installation of ephemeral RHSSO ############## # |
| | | |
| | | # ###### Start of Installation of Fuse Online ########## |
| | | # ###### Start of Installation of Fuse Online ########## # |
| | | |
| | | - name: check if Fuse Online is deployed |
| | | shell: "oc get project {{fuseonline_ocp_project}}" |
| | |
| | | command: "oc label namespace {{fuseonline_ocp_project}} AAD='{{guid}}'" |
| | | when: fuseonline_project_result is failed |
| | | |
| | | - name: Make sure we go back to the default project |
| | | shell: "oc project default" |
| | | - name: "Make sure we go back to project {{fuseonline_ocp_project}}" |
| | | shell: "oc project {{fuseonline_ocp_project}}" |
| | | when: fuseonline_project_result is failed |
| | | |
| | | - name: Retrieve Fuse Online Installation Script |
| | |
| | | |
| | | # ###### Start of Creation of NodeJS project ########## |
| | | |
| | | - name: check if NodeJS is deployed |
| | | - name: check if NodeJS Project exists |
| | | shell: "oc get project {{nodejs_ocp_project}}" |
| | | register: nodejs_project_result |
| | | ignore_errors: true |
| | |
| | | command: "oc label namespace {{nodejs_ocp_project}} AAD='{{guid}}'" |
| | | when: nodejs_project_result is failed |
| | | |
| | | - name: Make sure we go back do default project |
| | | shell: "oc project default" |
| | | - name: "Make sure we go back to project {{nodejs_ocp_project}}" |
| | | shell: "oc project {{nodejs_ocp_project}}" |
| | | when: nodejs_project_result is failed |
| | | |
| | | # ###### End of NodeJS Project creation ########## |
| | | |
| | | # ###### Start of 3scale Gateway Project creation ########## |
| | | |
| | | - name: check if 3scale Gateway Project exists |
| | | shell: "oc get project {{3scalegw_ocp_project}}" |
| | | register: 3scalegw_project_result |
| | | ignore_errors: true |
| | | changed_when: false |
| | | |
| | | - name: "Create project {{3scalegw_ocp_project}}" |
| | | shell: "oc new-project {{3scalegw_ocp_project}} --display-name={{3scalegw_ocp_project}} --description={{ocp_username}}" |
| | | when: 3scalegw_project_result is failed |
| | | |
| | | - name: "Label namespace" |
| | | command: "oc label namespace {{3scalegw_ocp_project}} AAD='{{guid}}'" |
| | | when: 3scalegw_project_result is failed |
| | | |
| | | - name: "Make sure we go back to project {{3scalegw_ocp_project}}" |
| | | shell: "oc project {{3scalegw_ocp_project}}" |
| | | when: 3scalegw_project_result is failed |
| | | |
| | | - name: "Delete default routes in project {{3scalegw_ocp_project}}" |
| | | shell: "oc delete route --all" |
| | | when: 3scalegw_project_result is failed |
| | | |
| | | - name: "Create staging route quote-stage in project {{3scalegw_ocp_project}}" |
| | | shell: "oc create route edge quote-stage --service='stage-apicast' --hostname={{ocp_username}}-quote-stage.$OCP_SUFFIX" |
| | | when: 3scalegw_project_result is failed |
| | | |
| | | - name: "Create staging route quote-prod in project {{3scalegw_ocp_project}}" |
| | | shell: "oc create route edge quote-prod --service='prod-apicast' --hostname={{ocp_username}}-quote-prod.{{$OCP_SUFFIX}}" |
| | | when: 3scalegw_project_result is failed |
| | | |
| | | - name: check if project {{3scalemt_ocp_project}} exists |
| | | shell: "oc get project {{3scalemt_ocp_project}}" |
| | | register: 3scalemt_project_result |
| | | ignore_errors: true |
| | | changed_when: false |
| | | |
| | | - name: "Create project {{3scalemt_ocp_project}}" |
| | | shell: "oc new-project {{3scalemt_ocp_project}} --display-name={{3scalemt_ocp_project}} --description={{ocp_username}}" |
| | | when: 3scalemt_project_result is failed |
| | | |
| | | - name: "Label namespace" |
| | | command: "oc label namespace {{3scalemt_ocp_project}} AAD='{{guid}}'" |
| | | when: 3scalemt_project_result is failed |
| | | |
| | | - name: "Make sure we go back to project {{3scalemt_ocp_project}}" |
| | | shell: "oc project {{3scalemt_ocp_project}}" |
| | | when: 3scalemt_project_result is failed |
| | | |
| | | - name: "Delete default routes in project {{3scalemt_ocp_project}}" |
| | | shell: "oc delete route --all" |
| | | when: 3scalemt_project_result is failed |
| | | |
| | | - name: "Delete default route in project {{3scalemt_ocp_project}}" |
| | | shell: "oc create route edge {{ocp_username}}-3scale-mt-developer --service='system-developer' --hostname={{ocp_username}}-3scale-mt.{{$OCP_SUFFIX}}" |
| | | when: 3scalemt_project_result is failed |
| | | |
| | | # ###### End of 3scale Gateway Project creation ########## |
| | | |
| | | - name: workload Tasks Complete |
| | | debug: |
| | | msg: workload Tasks Complete |