File tree Expand file tree Collapse file tree 2 files changed +44
-0
lines changed
roles/callhome_configure/tasks Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change 33- import_tasks : configure.yml
44 when : scale_callhome_params is defined and scale_callhome_params.is_enabled|bool
55 tags : config
6+
7+ - import_tasks : unconfigure.yml
8+ when :
9+ - scale_callhome_params is defined and not scale_callhome_params.is_enabled | bool
10+ - scale_callhome_params.scale_state is defined and scale_callhome_params.scale_state == 'absent'
11+ tags : config
Original file line number Diff line number Diff line change 1+ ---
2+ - block :
3+ - name : check | Ensure callhome deletion is applicable
4+ assert :
5+ that :
6+ - scale_callhome_params.is_enabled is defined
7+ - not scale_callhome_params.is_enabled | bool
8+ fail_msg : " Callhome is still enabled. Skipping deletion."
9+ success_msg : " Callhome is disabled. Proceeding to delete callhome."
10+ when : ansible_hostname == scale_callhome_params.callhome_server
11+
12+ - name : delete | Disable callhome capability
13+ shell : " {{ scale_command_path }}mmcallhome capability disable"
14+ register : scale_callhome_disable
15+ ignore_errors : true
16+
17+ - name : delete | Get list of callhome groups
18+ shell : " {{ scale_command_path }}mmcallhome group list | awk 'NR>1 {print $1}'"
19+ register : scale_callhome_groups
20+ changed_when : false
21+
22+ - name : delete | Remove each callhome group
23+ shell : " {{ scale_command_path }}mmcallhome group delete {{ item }}"
24+ with_items : " {{ scale_callhome_groups.stdout_lines }}"
25+ register : scale_callhome_group_delete
26+ ignore_errors : true
27+ when : scale_callhome_groups.stdout_lines is defined and
28+ scale_callhome_groups.stdout_lines | length > 0
29+
30+ - name : delete | Disable proxy (if configured)
31+ shell : " {{ scale_command_path }}mmcallhome proxy disable"
32+ register : scale_callhome_proxy_disable
33+ ignore_errors : true
34+
35+ - debug :
36+ msg : " Callhome deleted (capability, groups, proxy disabled)."
37+ when : scale_callhome_params.scale_state is defined and scale_callhome_params.scale_state == 'absent'
38+ run_once : true
You can’t perform that action at this time.
0 commit comments