-
Notifications
You must be signed in to change notification settings - Fork 82
/
provision.yml
79 lines (65 loc) · 2.89 KB
/
provision.yml
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
---
- hosts: zos_host
collections:
- ibm.ibm_zos_core
gather_facts: false
environment: "{{environment_vars}}"
tasks:
- name: Provision, configure, and start Liberty server instance
block:
# Checks to see if the server under given name exists
- name: Check if server instance exists
stat:
path: "{{environment_vars.WLP_USER_DIR}}/servers/{{server_instance_name}}"
register: instance
- fail:
msg: Liberty server instance exists
when: instance.stat.exists == true
# invoke role to create zFS
- include_role:
name: create_zFS
# invoke role to mount a zFS
- include_role:
name: mount_zFS
# invoke role to create a new server instance
- include_role:
name: create_server
# role used to transfer custom configuration files; runs based on boolean value of CUSTOMIZE variable
- include_role:
name: configure_server
when: CUSTOMIZE | bool
# invoke role to enable starting the server as a STARTED task
- include_role:
name: started_server
# role used to create started profiles for angel process; runs based on boolean value of ANGEL variable
- include_role:
name: angel_config
when: ANGEL | bool
# role used to enable access to z/OS authorized services; runs based on AUTHORIZED_SERVICES variable
- include_role:
name: authorized_services
when: (ANGEL | bool) and (AUTHORIZED_SERVICES | bool) # angel process must be enabled for authorized services
# Start the angel process
- name: Start angel process
zos_operator:
cmd: "START {{ANGEL_PROC}}"
tags: start_angel # if tags are used while running the playbook, it has precendence over the when conditional
when: ANGEL | bool # assumes if you enable the angel process, you would want to start the angel process
register: angel_start_result
- name: Response from starting angel process
debug:
msg: "{{angel_start_result}}"
# Start and stop server process as STARTED tasks
# If you start the server with a STARTED task, must also stop the server with a STARTED task
- name: Start server process # start if not already started
zos_operator:
cmd: "START {{SERVER_PROC}}"
tags: start
register: start_result
- name: Response from starting server process
debug:
msg: "{{start_result}}"
# #Start the server -- USS shell example -- if you start the server in the shell, must also stop the server in the shell
# - name: Start the newly created WLP server #z/os operator task
# shell: '{{liberty_bin_path}}/server start {{server_instance_name}}'
# tags: start