---
|
# Implement your Workload deployment tasks here
|
|
- name: Setting up workload for user
|
debug:
|
msg: "Setting up workload for user ocp_username = {{ ocp_username }}"
|
|
- name: Install tekton CLI (tkn)
|
become: yes
|
unarchive:
|
src: "{{ _tekton_cli_url }}"
|
remote_src: yes
|
dest: /usr/local/bin
|
mode: 0775
|
owner: root
|
group: root
|
|
- name: Install yq CLI
|
become: yes
|
get_url:
|
url: "{{ _yq_cli_url }}"
|
dest: /usr/local/bin/yq
|
mode: 0775
|
owner: root
|
group: root
|
|
- name: Install knative CLI (kn)
|
become: yes
|
get_url:
|
url: "{{ _knative_cli_url }}"
|
dest: /usr/local/bin/kn
|
mode: 0775
|
owner: root
|
group: root
|
|
- name: Install OpenShift Pipelines
|
k8s:
|
state: present
|
definition: "{{ lookup('file', './files/pipelines-subscription.yml') }}"
|
tags:
|
- pipelines
|
|
- name: Wait until OpenShift Pipelines Operator CRD is installed
|
k8s_info:
|
api_version: apiextensions.k8s.io/v1beta1
|
kind: CustomResourceDefinition
|
name: config.operator.tekton.dev
|
ignore_errors: yes
|
delay: 10
|
register: tekton_operator_crd
|
retries: 20
|
until: tekton_operator_crd.resources | list | length == 1
|
|
- name: Wait until OpenShift Pipelines is installed
|
become: yes
|
k8s_info:
|
api_version: operator.tekton.dev/v1alpha1
|
kind: Config
|
name: cluster
|
ignore_errors: yes
|
delay: 10
|
register: tekton_cluster_config
|
retries: 20
|
until: ('resources' in tekton_cluster_config) and (tekton_cluster_config.resources | list | length == 1) and (tekton_cluster_config.resources[0].status.conditions[0].code == "installed")
|
|
- name: Create RHD Infra Project
|
k8s:
|
api_version: v1
|
kind: Namespace
|
name: "{{ _rhd_infra_project }}"
|
state: present
|
|
- name: Create Nexus Repository Server
|
shell: "oc -n {{ _rhd_infra_project }} new-app sonatype/nexus -o yaml | oc apply -n {{ _rhd_infra_project }} -f-"
|
|
# Leave this as the last task in the playbook.
|
- name: workload tasks complete
|
debug:
|
msg: "Workload Tasks completed successfully."
|
when: not silent|bool
|