-
Notifications
You must be signed in to change notification settings - Fork 6
/
sagenv-common-webmethods-postinstall.yaml
97 lines (90 loc) · 4.86 KB
/
sagenv-common-webmethods-postinstall.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
---
### minimum params:
### cce_provisioning_inventory_hosts_pattern (type: string - the target ansible group to install the CCE template)
### cce_provisioning_inventory_hosts_property (type: string - the property to lookup to find the actual network host of an alias)
### cce_provisioning_installed_product_names (type: list - the products installed by the template so we can create the right services etc...)
### cce_provisioning_installed_product_envs_by_name (type: dictionary)
### cce_provisioning_postinstall_service_setup (type: boolean)
### cce_provisioning_postinstall_reboot (type: boolean)
### cce_provisioning_validation_ports (type: list)
### cce_provisioning_validation_ports_timeout (type: number)
- import_playbook: sagenv-common-webmethods-load-vars.yaml
tags:
- always
- hosts: "{{ cce_provisioning_command_central_hosts | default('commandcentral') }}"
become: true
tasks:
- name: Print the params for the webMethods post install tasks
debug:
msg:
- "Common webMethods postinstall tasks with params:"
- "cce_provisioning_inventory_hosts_pattern = {{ cce_provisioning_inventory_hosts_pattern | default('undefined') }}"
- "cce_provisioning_inventory_hosts_property = {{ cce_provisioning_inventory_hosts_property | default('undefined') }}"
- "cce_provisioning_installed_product_names = {{ cce_provisioning_installed_product_names | default('undefined') }}"
- "cce_provisioning_installed_product_instance_names = {{ cce_provisioning_installed_product_instance_names | default('undefined') }}"
- "cce_provisioning_installed_product_envs_by_name = {{ cce_provisioning_installed_product_envs_by_name | default('undefined') }}"
- "cce_provisioning_postinstall_webmethods = {{ cce_provisioning_postinstall_webmethods | default('undefined') }}"
- "cce_provisioning_postinstall_service_setup = {{ cce_provisioning_postinstall_service_setup | default('undefined') }}"
- "cce_provisioning_postinstall_reboot = {{ cce_provisioning_postinstall_reboot | default('undefined') }}"
- "cce_provisioning_validation_ports = {{ cce_provisioning_validation_ports | default('undefined') }}"
- "cce_provisioning_validation_ports_timeout = {{ cce_provisioning_validation_ports_timeout | default('undefined') }}"
tags:
- always
##stop process before installing and starting the service
- hosts: "{{ cce_provisioning_inventory_hosts_pattern }}"
tasks:
- name: Root tasks
block:
- import_role:
name: post-install-webmethods
vars:
postinstall_do_reboot: false
when: cce_provisioning_postinstall_webmethods|bool
- import_role:
name: service-webmethods
vars:
product_command: "create"
product_name: "{{ cce_provisioning_installed_product_names }}"
product_instance_name: "{{ cce_provisioning_installed_product_instance_names }}"
force_create: false
service_user: "{{ webmethods_user }}"
when: cce_provisioning_postinstall_service_setup|bool
## this makes sure that the product is runing from the system services as opposed to a manually started one
## IMPORTANT TODO / improvement: We should detect for the condition and only restart things if needed (if possible)
- import_role:
name: command-webmethods
vars:
product_command: "stop"
product_name: "{{ cce_provisioning_installed_product_names }}"
product_instance_name: "{{ cce_provisioning_installed_product_instance_names }}"
become: true
become_user: "{{ webmethods_user }}"
when: cce_provisioning_postinstall_service_setup|bool
- import_role:
name: service-webmethods
vars:
product_command: "restart"
product_name: "{{ cce_provisioning_installed_product_names }}"
product_instance_name: "{{ cce_provisioning_installed_product_instance_names }}"
when: cce_provisioning_postinstall_service_setup|bool
- name: "Reboot the machine ONLY IF postinstall_reboot set to true"
reboot:
reboot_timeout: 1000
when: cce_provisioning_postinstall_reboot is defined and cce_provisioning_postinstall_reboot == true
become: true
tags:
- postinstall
#check ports
- hosts: "{{ cce_provisioning_command_central_hosts | default('commandcentral') }}"
become: true
become_user: "{{ cce_owner }}"
tasks:
- import_role:
name: check-remote-ports
vars:
inventory_pattern: "{{ cce_provisioning_inventory_hosts_pattern }}"
inventory_hosts_property: "{{ cce_provisioning_inventory_hosts_property }}"
validation_ports: "{{ cce_provisioning_validation_ports }}"
validation_ports_timeout: "{{ cce_provisioning_validation_ports_timeout }}"
tags:
- postinstall