| | |
| | | --- |
| | | # Implement your Post Workload deployment tasks here |
| | | |
| | | - name: find tekton subscription |
| | | set_fact: |
| | | tkn_sub: "{{ lookup('k8s', api_version='operators.coreos.com/v1alpha1', kind='Subscription',namespace='openshift-operators', resource_name='openshift-pipelines') | json_query('status.installedCSV') }}" |
| | | |
| | | - set_fact: |
| | | tkn_installed: "{{pipelines_operator_name + '.' + tkn_sub == pipelines_operator_name + '.' + pipelines_operator_version}}" |
| | | |
| | | - name: Checking if right version of Tekton is installed |
| | | fail: |
| | | msg: "Right version of Tekton not installed expecting {{operator_version}} but got {{tkn_sub}} " |
| | | when: tkn_installed |
| | | |
| | | - name: find Tekton API versions |
| | | set_fact: |
| | | tkn_api_versions: "{{ tkn_api_versions + [{ item : lookup('k8s', api_version='apiextensions.k8s.io/v1beta1', kind='CustomResourceDefinition', resource_name='tasks.'+api_group) | json_query('spec.versions[*].name')}] }}" |
| | | with_items: "{{crds}}" |
| | | |
| | | - set_fact: |
| | | api_delta: "{{ expected_tkn_api_versions | difference(tkn_api_versions) }}" |
| | | |
| | | - name: Is there is difference in API versions |
| | | fail: |
| | | msg: "There is difference in API: {{api_delta}}" |
| | | when: api_delta | length > 0 |
| | | |
| | | - name: Check if tkn installed |
| | | shell: tkn version |
| | | register: tkn_version |
| | | |
| | | - name: Check tkn version |
| | | fail: |
| | | msg: Check if tkn version {{ _tekton_version }} |
| | | when: not tkn_version.stdout is search(_tekton_version) |
| | | |
| | | - name: Check yq exists |
| | | shell: yq --version |
| | | register: yq_version |
| | | |
| | | - name: Check yq version |
| | | fail: |
| | | msg: Check if "yq version {{ _yq_version }}" |
| | | when: not yq_version.stdout is search(_yq_version) |
| | | |
| | | - name: Check if kn installed |
| | | shell: kn version |
| | | register: kn_version |
| | | |
| | | - name: Check if "kn version is v0.12.0 |
| | | fail: |
| | | msg: Check if kn version is {{ _knative_version }} |
| | | when: not kn_version.stdout is search(_knative_version) |
| | | |
| | | |
| | | # Leave these as the last tasks in the playbook |
| | | |
| | | # For deployment onto a dedicated cluster (as part of the |