-
Notifications
You must be signed in to change notification settings - Fork 0
/
playbook.yaml
65 lines (57 loc) · 1.89 KB
/
playbook.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# (c) Copyright IBM Corp. 2024
# Apache License, Version 2.0 (see https://opensource.org/licenses/Apache-2.0)
---
- name: Update existing CSD with resource builder yaml
hosts: all
gather_facts: false
environment: "{{ environment_vars }}"
vars:
uss_dest_path: "/u/{{ ansible_user | lower }}/ansible-resource-builder"
model_path: "{{ uss_dest_path }}/model.yaml"
defs_path: "{{ uss_dest_path }}/defs.yaml"
script_path: "{{ uss_dest_path }}/script"
csd_path: "HUGHEA.REGIONS.IYK2ZPZ5.DFHCSD"
tasks:
- name: Ensure destination directory exists
ansible.builtin.file:
path: "{{ uss_dest_path }}"
state: directory
mode: '0755'
- name: Copy resource model YAML to USS
ibm.ibm_zos_core.zos_copy:
src: "{{ playbook_dir }}/cics-model.yaml"
dest: "{{ model_path }}"
force: true
encoding:
from: ISO8859-1
to: ISO8859-1
- name: Copy resource definitions YAML to USS
ibm.ibm_zos_core.zos_copy:
src: "{{ playbook_dir }}/cics-definitions.yaml"
dest: "{{ defs_path }}"
force: true
encoding:
from: ISO8859-1
to: ISO8859-1
- name: Check CICS resource builder is setup
ansible.builtin.command:
cmd: zrb --version
changed_when: false
- name: Generate definitions
ansible.builtin.command:
cmd: zrb build -r "{{ defs_path }}" -m "{{ model_path }}" -o "{{ script_path }}"
changed_when: true
- name: Update CSD with new definitions
ibm.ibm_zos_cics.csd:
state: changed
input_location: USS
input_src: "{{ script_path }}"
region_data_sets:
dfhcsd:
dsn: "{{ csd_path }}"
cics_data_sets:
sdfhload: "CTS610.CICS740.SDFHLOAD"
- name: Cleanup USS files
ansible.builtin.file:
path: "{{ uss_dest_path }}"
state: absent