OpenShift Origin Implementation at ITIX (mostly Ansible Playbooks)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
1.9 KiB

---
- name: Get a list of existing projects
command: oc get projects -o name
register: oc_get_projects
changed_when: false
- name: Create a new project for Minio
command: oc new-project "{{ itix_xch_project }}"
when: '"projects/" ~ itix_xch_project not in oc_get_projects.stdout_lines'
- name: Query existing deploymentconfigs
command: oc get dc -n "{{ itix_xch_project }}" -o name -l "app=minio"
register: oc_get_dc
changed_when: false
- name: Deploy app if needed
set_fact:
deploy_needed: "{{ 'deploymentconfigs/minio' not in oc_get_dc.stdout_lines }}"
- name: Process the OpenShift Template and create the OpenShift objects
command: oc new-app -n {{ itix_xch_project }} {{ itix_xch_template }} -p "MINIO_ROUTE_HOSTNAME={{ itix_xch_hostname }}"
when: deploy_needed
- name: Wait for OpenShift to create all objects
pause:
seconds: '{{ itix_xch_delay }}'
when: deploy_needed
- include: common/wait_for.yml
static: no
vars:
pod_to_wait:
- minio
delay: "{{ itix_xch_delay }}"
retries: "{{ itix_xch_retries }}"
project: "{{ itix_xch_project }}"
tags: status
- name: Get Admin Username
command: oc get dc minio -n "{{ itix_xch_project }}" -o 'jsonpath={.spec.template.spec.containers[0].env[?(@.name=="MINIO_ACCESS_KEY")].value}'
register: username
changed_when: false
tags: status
- name: Get Admin Password
command: oc get dc minio -n "{{ itix_xch_project }}" -o 'jsonpath={.spec.template.spec.containers[0].env[?(@.name=="MINIO_SECRET_KEY")].value}'
register: password
changed_when: false
tags: status
- name: Get Route URL
command: oc get route minio -n "{{ itix_xch_project }}" -o 'jsonpath={.spec.host}'
register: route
changed_when: false
tags: status
- set_fact:
xch_route_name: '{{ route.stdout }}'
- name: Minio is ready !
debug: msg="Login on https://{{ xch_route_name }}/ with username = '{{ username.stdout }}' and password = '{{ password.stdout }}'"
tags: status