mirror of
https://github.com/ansible/awx.git
synced 2024-10-30 22:21:13 +03:00
2b9954c373
- Secretification of secret stuff - Backup / restore
35 lines
1.2 KiB
YAML
35 lines
1.2 KiB
YAML
---
|
|
- name: Get Project Detail
|
|
shell: "{{ openshift_oc_bin }} get project {{ openshift_project }}"
|
|
register: project_details
|
|
ignore_errors: yes
|
|
|
|
- name: Create AWX Openshift Project
|
|
shell: "{{ openshift_oc_bin }} new-project {{ openshift_project }}"
|
|
when: project_details.rc != 0
|
|
|
|
- name: Ensure PostgreSQL PVC is available
|
|
block:
|
|
- name: Check PVC status
|
|
command: "{{ openshift_oc_bin }} get pvc {{ openshift_pg_pvc_name }} -n {{ openshift_project }} -o=jsonpath='{.status.phase}'"
|
|
register: pg_pvc_status
|
|
ignore_errors: yes
|
|
|
|
- name: Ensure PostgreSQL PVC is available
|
|
assert:
|
|
that:
|
|
- pg_pvc_status.stdout == "Bound"
|
|
msg: "Ensure a PVC named '{{ openshift_pg_pvc_name }}' is created and bound in the '{{ openshift_project }}' namespace."
|
|
when:
|
|
- pg_hostname is not defined or pg_hostname == ''
|
|
- openshift_pg_emptydir is defined and (openshift_pg_emptydir | bool) != true
|
|
|
|
- name: Set postgresql service name
|
|
set_fact:
|
|
postgresql_service_name: "postgresql"
|
|
when: "pg_hostname is not defined or pg_hostname == ''"
|
|
|
|
- name: Add privileged SCC to service account
|
|
shell: |
|
|
{{ openshift_oc_bin }} adm policy add-scc-to-user privileged system:serviceaccount:{{ openshift_project }}:awx
|