-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor to use include_roles and wait for content PVC to be created …
…when restoring
- Loading branch information
1 parent
8383aa3
commit 4ca8436
Showing
14 changed files
with
183 additions
and
130 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
- name: Get information about the cluster | ||
set_fact: | ||
api_groups: "{{ lookup('k8s', cluster_info='api_groups') }}" | ||
when: | ||
- not is_openshift | ||
- not is_k8s | ||
|
||
- name: Determine the cluster type | ||
set_fact: | ||
is_openshift: "{{ True if 'route.openshift.io' in api_groups else False }}" | ||
is_k8s: "{{ False if 'route.openshift.io' in api_groups else True }}" | ||
when: | ||
- not is_openshift | ||
- not is_k8s | ||
|
||
# Indicate what kind of cluster we are in (OpenShift or Kubernetes). | ||
- debug: | ||
msg: "CLUSTER TYPE: is_openshift={{ is_openshift }}; is_k8s={{ is_k8s }}" | ||
|
||
- block: | ||
- k8s_status: | ||
api_version: "{{ api_version }}" | ||
kind: "{{ kind }}" | ||
name: "{{ ansible_operator_meta.name }}" | ||
namespace: "{{ ansible_operator_meta.namespace }}" | ||
conditions: | ||
- type: "{{ deployment_type|capitalize }}-API-Ready" | ||
message: Cannot determine what type of cluster we are in | ||
reason: FailedToIdentifyClusterType | ||
status: "False" | ||
lastTransitionTime: "{{ lookup('pipe', 'date --iso-8601=seconds') }}" | ||
|
||
- fail: | ||
msg: "Cannot determine what type of cluster we are in" | ||
|
||
when: | ||
- not is_openshift | ||
- not is_k8s |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--- | ||
- set_fact: | ||
is_file_storage: false | ||
when: | ||
- object_storage_secret is defined | ||
|
||
- name: pulp-file-storage | ||
block: | ||
- name: "Creating {{ deployment_type|capitalize }}-api PVC resource" | ||
k8s_status: | ||
api_version: "{{ api_version }}" | ||
kind: "{{ kind }}" | ||
name: "{{ ansible_operator_meta.name }}" | ||
namespace: "{{ ansible_operator_meta.namespace }}" | ||
conditions: | ||
- type: "{{ deployment_type|capitalize }}-API-Ready" | ||
message: "Creating {{ deployment_type|capitalize }}-api PVC resource" | ||
reason: CreatingPVC | ||
status: "False" | ||
lastTransitionTime: "{{ lookup('pipe', 'date --iso-8601=seconds') }}" | ||
|
||
- name: pulp-file-storage persistent volume claim | ||
k8s: | ||
state: "{{ deployment_state }}" | ||
definition: "{{ lookup('template', 'templates/' + item + '.pvc.yaml.j2') | from_yaml }}" | ||
with_items: | ||
- pulp-file-storage | ||
|
||
- name: "Removing ownerReferences from {{ ansible_operator_meta.name}}-file-storage PVC" | ||
k8s_status: | ||
api_version: "{{ api_version }}" | ||
kind: "{{ kind }}" | ||
name: "{{ ansible_operator_meta.name }}" | ||
namespace: "{{ ansible_operator_meta.namespace }}" | ||
conditions: | ||
- type: "{{ deployment_type|capitalize }}-API-Ready" | ||
message: "Removing ownerReferences from {{ ansible_operator_meta.name}}-file-storage PVC" | ||
reason: RemovingPVCOwnerReferences | ||
status: "False" | ||
lastTransitionTime: "{{ lookup('pipe', 'date --iso-8601=seconds') }}" | ||
|
||
- name: Remove ownerReferences from pulp-file-storage pvc to avoid garbage collection | ||
k8s: | ||
definition: | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: '{{ ansible_operator_meta.name }}-file-storage' | ||
namespace: '{{ ansible_operator_meta.namespace }}' | ||
ownerReferences: null | ||
|
||
when: is_file_storage |
This file contains 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
File renamed without changes.
This file contains 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
Oops, something went wrong.