Skip to content

Commit 1562d52

Browse files
committed
fix manual subscriptions
1 parent f03232f commit 1562d52

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

common/roles/install_operator/tasks/main.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,36 @@
2424
register: create_sub
2525
until: create_sub is not failed
2626

27+
- name: Approve Manual InstallPlan
28+
when:
29+
- create_sub.changed
30+
- create_sub.result.spec.installPlanApproval == "Manual"
31+
block:
32+
- name: Get InstallPlanRef
33+
kubernetes.core.k8s_info:
34+
api_version: operators.coreos.com/v1alpha1
35+
kind: Subscription
36+
name: "{{ create_sub.result.metadata.name }}"
37+
namespace: "{{ create_sub.result.metadata.namespace }}"
38+
register: subscription
39+
until: subscription.resources[0].status.installPlanRef is defined
40+
retries: 60
41+
delay: 10
42+
43+
- name: Approve InstallPlan
44+
kubernetes.core.k8s:
45+
definition:
46+
apiVersion: "{{ subscription.resources[0].status.installPlanRef.apiVersion }}"
47+
kind: "{{ subscription.resources[0].status.installPlanRef.kind }}"
48+
metadata:
49+
name: "{{ subscription.resources[0].status.installPlanRef.name }}"
50+
namespace: "{{ subscription.resources[0].status.installPlanRef.namespace }}"
51+
spec:
52+
approved: true
53+
state: present
54+
register: k8s_result
55+
until: k8s_result is not failed
56+
2757
- name: Wait for operator to be deployed
2858
kubernetes.core.k8s_info:
2959
api_version: operators.coreos.com/v1alpha1

0 commit comments

Comments
 (0)