Pull in downstream k8s installer changes

- Secretification of secret stuff
- Backup / restore
This commit is contained in:
Shane McDonald
2018-08-14 12:22:43 -04:00
parent 2e6a7205e7
commit 2b9954c373
14 changed files with 537 additions and 151 deletions

View File

@@ -1,53 +1,4 @@
---
- include_vars: openshift.yml
- name: Set kubernetes_namespace
set_fact:
kubernetes_namespace: "{{ openshift_project }}"
- name: Ensure workspace directories exist
file:
path: "{{ item }}"
state: directory
with_items:
- "{{ kubernetes_base_path }}"
- "{{ openshift_oc_config_file | dirname }}"
- name: Authenticate with OpenShift via user and password
shell: |
{{ openshift_oc_bin }} login {{ openshift_host }} \
-u {{ openshift_user }} \
-p {{ openshift_password }} \
--insecure-skip-tls-verify={{ openshift_skip_tls_verify | default(false) | bool }}
when:
- openshift_user is defined
- openshift_password is defined
- openshift_token is not defined
register: openshift_auth_result
ignore_errors: true
no_log: true
- name: OpenShift authentication failed on TLS verification
fail:
msg: "Failed to verify TLS, consider settings openshift_skip_tls_verify=True {{ openshift_auth_result.stderr }}"
when:
- openshift_skip_tls_verify is not defined or not openshift_skip_tls_verify
- openshift_auth_result.rc != 0
- openshift_auth_result.stderr | search("certificate that does not match its hostname")
- name: OpenShift authentication failed
fail:
msg: "{{ openshift_auth_result.stderr }}"
when: openshift_auth_result.rc != 0
- name: Authenticate with OpenShift via token
shell: |
{{ openshift_oc_bin }} login {{ openshift_host }} \
--token {{ openshift_token }} \
--insecure-skip-tls-verify={{ openshift_skip_tls_verify | default(false) | bool }}
when: openshift_token is defined
no_log: true
- name: Get Project Detail
shell: "{{ openshift_oc_bin }} get project {{ openshift_project }}"
register: project_details
@@ -77,3 +28,7 @@
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