Skip to content

Commit 883b164

Browse files
authored
Update deploy-pre-ansible-playbook.yaml
1 parent 3fdbe4f commit 883b164

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

patterns/roks/scripts/deploy-pre-ansible-playbook.yaml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
1-
- name: Undeploy post playbook
1+
- name: deploy pre playbook
22
hosts: localhost
3-
vars:
4-
workspace_id: "{{ lookup('ansible.builtin.env', 'workspace_id')}}"
53
tasks:
4+
- name: Login to ibmcloud
5+
ansible.builtin.shell:
6+
cmd: ibmcloud login --apikey "{{ ibmcloud_api_key }}" -q -r {{ workspace_id.split(".")[0] }}
67
- name: Get Template ID
78
ansible.builtin.shell:
89
cmd: ibmcloud schematics workspace get --id "{{ workspace_id }}" -o json | jq -r .template_data[0].id
910
register: template_id
11+
- name: Print the Template ID
12+
ansible.builtin.debug:
13+
var: template_id
1014
- name: Get Cluster names
1115
ansible.builtin.shell:
1216
cmd: ibmcloud schematics state pull --id "{{ workspace_id }}" --template "{{ template_id.stdout }}" | jq -r '.outputs.cluster_names.value' | tr -d '[]," '
1317
register: cluster_names
18+
- name: Print the Cluster names
19+
ansible.builtin.debug:
20+
var: cluster_names
1421
- name: Print the updated list
1522
ansible.builtin.debug:
1623
var: cluster_names.stdout_lines

0 commit comments

Comments
 (0)