-
Notifications
You must be signed in to change notification settings - Fork 11
/
file_system_deployment.yaml
84 lines (73 loc) · 2.56 KB
/
file_system_deployment.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
---
- name: Commvault Ansible
gather_facts: no
hosts: localhost
connection: local
vars:
webconsole_hostname: 'webconsole_hostname'
commcell_username: 'commcell_username'
commcell_password: 'commcell_password'
tasks:
- name: Commvault commcell initialization
block:
- name: Login
commvault:
operation: LOGIN
entity: {
webconsole_hostname: "{{ webconsole_hostname }}",
commcell_username: "{{ commcell_username }}",
commcell_password: "{{ commcell_password }}"
}
register: commcell
- debug:
msg: "Login is done successfully"
rescue:
- debug:
msg: 'Login failed'
# Either Unix or Windows clients_computers should be chosen and not both
# windows packages - https://github.com/CommvaultEngg/cvpysdk/blob/master/cvpysdk/deployment/deploymentconstants.py#L79
# Unix packages - https://github.com/CommvaultEngg/cvpysdk/blob/master/cvpysdk/deployment/deploymentconstants.py#L59
# Install software method is available on commcell.py module in cvpysdk - https://github.com/CommvaultEngg/cvpysdk/blob/master/cvpysdk/commcell.py#L1684
- name: Windows FS package installation
commvault:
operation: install_software
entity_type: commcell
commcell: "{{ commcell }}"
args: {
client_computers: ["client_name"],
windows_features: [702], # 702 is File System
username: "username",
password: "password"
}
register: install_job
- debug:
msg: "Successfully started install job: {{ install_job.output }}"
- name: wait for install job to complete
when: install_job is succeeded
commvault:
operation: "wait_for_completion"
entity_type: "job"
commcell: "{{ commcell }}"
entity: {
job_id: "{{ install_job.output }}"
}
register: status
- name: install job failure reason
when: status.output == false
commvault:
operation: "delay_reason"
entity_type: "job"
commcell: "{{ commcell }}"
entity: {
job_id: "{{ install_job.output }}"
}
register: failure_reason
- debug:
msg: "{{ failure_reason.output }}"
when: status.output == false
ignore_errors: yes
- debug:
msg: "{{ install job completed successfully }}"
when: status.output == true
ignore_errors: yes
...