| 1 |
# idrac_export_server_config_profile |
| 2 |
|
| 3 |
Role to Export the Server Configuration Profile (SCP) from the iDRAC to a network share (CIFS, NFS, HTTP, HTTPS) or a local path. |
| 4 |
|
| 5 |
## Requirements |
| 6 |
|
| 7 |
### Development |
| 8 |
Requirements to develop and contribute to the role. |
| 9 |
``` |
| 10 |
ansible |
| 11 |
docker |
| 12 |
molecule |
| 13 |
python |
| 14 |
``` |
| 15 |
### Production |
| 16 |
Requirements to use the role. |
| 17 |
``` |
| 18 |
ansible |
| 19 |
python |
| 20 |
``` |
| 21 |
|
| 22 |
### Ansible collections |
| 23 |
Collections required to use the role |
| 24 |
``` |
| 25 |
dellemc.openmanage |
| 26 |
``` |
| 27 |
|
| 28 |
## Role Variables |
| 29 |
|
| 30 |
<table> |
| 31 |
<thead> |
| 32 |
<tr> |
| 33 |
<th>Name</th> |
| 34 |
<th>Required</th> |
| 35 |
<th>Default Value</th> |
| 36 |
<th>Choices</th> |
| 37 |
<th>Type</th> |
| 38 |
<th>Description</th> |
| 39 |
</tr> |
| 40 |
</thead> |
| 41 |
<tbody> |
| 42 |
<tr> |
| 43 |
<td>idrac_ip</td> |
| 44 |
<td>true</td> |
| 45 |
<td></td> |
| 46 |
<td></td> |
| 47 |
<td>str</td> |
| 48 |
<td>- iDRAC IP Address</td> |
| 49 |
</tr> |
| 50 |
<tr> |
| 51 |
<td>idrac_user</td> |
| 52 |
<td>true</td> |
| 53 |
<td></td> |
| 54 |
<td></td> |
| 55 |
<td>str</td> |
| 56 |
<td>- iDRAC username</td> |
| 57 |
</tr> |
| 58 |
<tr> |
| 59 |
<td>idrac_password</td> |
| 60 |
<td>true</td> |
| 61 |
<td></td> |
| 62 |
<td></td> |
| 63 |
<td>str</td> |
| 64 |
<td>- iDRAC user password.</td> |
| 65 |
</tr> |
| 66 |
<tr> |
| 67 |
<td>idrac_port</td> |
| 68 |
<td>false</td> |
| 69 |
<td>443</td> |
| 70 |
<td></td> |
| 71 |
<td>int</td> |
| 72 |
<td>- iDRAC port.</td> |
| 73 |
</tr> |
| 74 |
<tr> |
| 75 |
<td>validate_certs</td> |
| 76 |
<td>false</td> |
| 77 |
<td>true</td> |
| 78 |
<td></td> |
| 79 |
<td>bool</td> |
| 80 |
<td>- If C(false), the SSL certificates will not be validated.<br>- Configure C(false) only on personally controlled sites where self-signed certificates are used.</td> |
| 81 |
</tr> |
| 82 |
<tr> |
| 83 |
<td>ca_path</td> |
| 84 |
<td>false</td> |
| 85 |
<td></td> |
| 86 |
<td></td> |
| 87 |
<td>path</td> |
| 88 |
<td>- The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation.</td> |
| 89 |
</tr> |
| 90 |
<tr> |
| 91 |
<td>idrac_timeout</td> |
| 92 |
<td>false</td> |
| 93 |
<td>30</td> |
| 94 |
<td></td> |
| 95 |
<td>int</td> |
| 96 |
<td>- The HTTPS socket level timeout in seconds.</td> |
| 97 |
</tr> |
| 98 |
<tr> |
| 99 |
<td>share_parameters</td> |
| 100 |
<td>false</td> |
| 101 |
<td></td> |
| 102 |
<td></td> |
| 103 |
<td>dict</td> |
| 104 |
<td>Network share parameters.</td> |
| 105 |
</tr> |
| 106 |
<tr> |
| 107 |
<td> share_name</td> |
| 108 |
<td>true</td> |
| 109 |
<td></td> |
| 110 |
<td></td> |
| 111 |
<td>str</td> |
| 112 |
<td>- Network share or local path.<br>- CIFS, NFS, HTTP, and HTTPS network share types are supported.</td> |
| 113 |
</tr> |
| 114 |
<tr> |
| 115 |
<td> scp_file</td> |
| 116 |
<td>false</td> |
| 117 |
<td></td> |
| 118 |
<td></td> |
| 119 |
<td>str</td> |
| 120 |
<td>- Name of the server configuration profile (SCP) file.</br>- The default format `idrac_ip_YYMMDD_HHMMSS_scp` is used if this option is not specified.</br>- I(export_format) is used if the valid extension file is not provided.</td> |
| 121 |
</tr> |
| 122 |
<tr> |
| 123 |
<td> share_user</td> |
| 124 |
<td>false</td> |
| 125 |
<td></td> |
| 126 |
<td></td> |
| 127 |
<td>str</td> |
| 128 |
<td>- Network share user in the format 'user@domain' or 'domain\\user' if user is part of a domain else 'user'. This option is mandatory for CIFS Network Share..</td> |
| 129 |
</tr> |
| 130 |
<tr> |
| 131 |
<td> share_password</td> |
| 132 |
<td>false</td> |
| 133 |
<td></td> |
| 134 |
<td></td> |
| 135 |
<td>str</td> |
| 136 |
<td>- Network share user password. This option is mandatory for CIFS Network Share.</td> |
| 137 |
</tr> |
| 138 |
<tr> |
| 139 |
<td> proxy_support</td> |
| 140 |
<td>false</td> |
| 141 |
<td>false</td> |
| 142 |
<td></td> |
| 143 |
<td>bool</td> |
| 144 |
<td>- Proxy to be enabled or disabled.</br>- I(proxy_support) is considered only when I(share_name) is of type HTTP or HTTPS and is supported only on iDRAC9.</td> |
| 145 |
</tr> |
| 146 |
<tr> |
| 147 |
<td> proxy_type</td> |
| 148 |
<td>false</td> |
| 149 |
<td>http</td> |
| 150 |
<td>http, socks4</td> |
| 151 |
<td>str</td> |
| 152 |
<td>- C(http) to select HTTP type proxy.</br>- C(socks4) to select SOCKS4 type proxy.</br>- I(proxy_type) is considered only when I(share_name) is of type HTTP or HTTPS and is supported only on iDRAC9.</td> |
| 153 |
</tr> |
| 154 |
<tr> |
| 155 |
<td> proxy_server</td> |
| 156 |
<td>false</td> |
| 157 |
<td></td> |
| 158 |
<td></td> |
| 159 |
<td>str</td> |
| 160 |
<td> - I(proxy_server) is required when I(share_name) is of type HTTPS or HTTP and I(proxy_support) is C(true).</br>- I(proxy_server) is considered only when I(share_name) is of type HTTP or HTTPS and is supported only on iDRAC9.</td> |
| 161 |
</tr> |
| 162 |
<tr> |
| 163 |
<td> proxy_port</td> |
| 164 |
<td>false</td> |
| 165 |
<td>80</td> |
| 166 |
<td></td> |
| 167 |
<td>str</td> |
| 168 |
<td>- Proxy port to authenticate.</br> - I(proxy_port) is required when I(share_name) is of type HTTPS or HTTP and I(proxy_support) is C(true).</br>- I(proxy_port) is considered only when I(share_name) is of type HTTP or HTTPS and is supported only on iDRAC9.</td> |
| 169 |
</tr> |
| 170 |
<tr> |
| 171 |
<td> proxy_username</td> |
| 172 |
<td>false</td> |
| 173 |
<td></td> |
| 174 |
<td></td> |
| 175 |
<td>str</td> |
| 176 |
<td>- Proxy username to authenticate.</br>- I(proxy_username) is considered only when I(share_name) is of type HTTP or HTTPS and is supported only on iDRAC9.</td> |
| 177 |
</tr> |
| 178 |
<tr> |
| 179 |
<td> proxy_password</td> |
| 180 |
<td>false</td> |
| 181 |
<td></td> |
| 182 |
<td></td> |
| 183 |
<td>str</td> |
| 184 |
<td>- Proxy password to authenticate.</br>- I(proxy_password) is considered only when I(share_name) is of type HTTP or HTTPS and is supported only on iDRAC9.</td> |
| 185 |
</tr> |
| 186 |
<tr> |
| 187 |
<td> ignore_certificate_warning</td> |
| 188 |
<td>false</td> |
| 189 |
<td>ignore</td> |
| 190 |
<td>ignore, showerror</td> |
| 191 |
<td>str</td> |
| 192 |
<td>- If C(ignore), it ignores the certificate warnings.</br>- If C(showerror), it shows the certificate warnings.</br>- I(ignore_certificate_warning) is considered only when I(share_name) is of type HTTPS and is supported only on iDRAC9.</td> |
| 193 |
</tr> |
| 194 |
<tr> |
| 195 |
<td>include_in_export</td> |
| 196 |
<td>false</td> |
| 197 |
<td>default</td> |
| 198 |
<td>default, readonly, passwordhashvalues, customtelemetry</td> |
| 199 |
<td>str</td> |
| 200 |
<td>- This option is applicable when I(command) is C(export).<br>- If C(default), it exports the default Server Configuration Profile.<br>- If C(readonly), it exports the SCP with readonly attributes.<br>- If C(passwordhashvalues), it exports the SCP with password hash values.<br>- If C(customtelemetry), exports the SCP with custom telemetry attributes supported only in the iDRAC9.</td> |
| 201 |
</tr> |
| 202 |
<tr> |
| 203 |
<td>target</td> |
| 204 |
<td>false</td> |
| 205 |
<td>['ALL']</td> |
| 206 |
<td>'ALL', 'IDRAC', 'BIOS', 'NIC', 'RAID'</td> |
| 207 |
<td>str</td> |
| 208 |
<td>- If C(ALL), this module exports or imports all components configurations from SCP file.<br>- If C(IDRAC), this module exports or imports iDRAC configuration from SCP file.<br>- If C(BIOS), this module exports or imports BIOS configuration from SCP file.<br>- If C(NIC), this module exports or imports NIC configuration from SCP file.<br>- If C(RAID), this module exports or imports RAID configuration from SCP file.</br>- When I(command) is C(export) or C(import) I(target) with multiple components is supported only on iDRAC9 with firmware 6.10.00.00 and above.</td> |
| 209 |
</tr> |
| 210 |
<tr> |
| 211 |
<td>export_format</td> |
| 212 |
<td>false</td> |
| 213 |
<td>'XML'</td> |
| 214 |
<td>'JSON', 'XML'</td> |
| 215 |
<td>str</td> |
| 216 |
<td>- Specify the output file format. This option is applicable for C(export) command.</td> |
| 217 |
</tr> |
| 218 |
<tr> |
| 219 |
<td>export_use</td> |
| 220 |
<td>false</td> |
| 221 |
<td>'Default'</td> |
| 222 |
<td>'Default', 'Clone', 'Replace'</td> |
| 223 |
<td></td> |
| 224 |
<td>- Specify the type of Server Configuration Profile (SCP) to be exported.<br>- This option is applicable when I(command) is C(export).<br>- C(Default) Creates a non-destructive snapshot of the configuration.<br>- C(Replace) Replaces a server with another or restores the servers settings to a known baseline.<br>- C(Clone) Clones settings from one server to another server with the identical hardware setup.</td> |
| 225 |
</tr> |
| 226 |
</tbody> |
| 227 |
</table> |
| 228 |
|
| 229 |
## Fact varaibles |
| 230 |
|
| 231 |
<table> |
| 232 |
<thead> |
| 233 |
<tr> |
| 234 |
<th>Name</th> |
| 235 |
<th>Sample</th> |
| 236 |
<th>Description</th> |
| 237 |
</tr> |
| 238 |
</thead> |
| 239 |
<tbody> |
| 240 |
<tr> |
| 241 |
<td>out_scp</td> |
| 242 |
<td>{ |
| 243 |
"changed": false, |
| 244 |
"failed": false, |
| 245 |
"msg": "Successfully exported the Server Configuration Profile.", |
| 246 |
"scp_status": { |
| 247 |
"ActualRunningStartTime": "2023-02-21T10:59:50", |
| 248 |
"ActualRunningStopTime": "2023-02-21T11:00:08", |
| 249 |
"CompletionTime": "2023-02-21T11:00:08", |
| 250 |
"Id": "JID_769771903262", |
| 251 |
"JobState": "Completed", |
| 252 |
"JobType": "ExportConfiguration", |
| 253 |
"Message": "Successfully exported Server Configuration Profile", |
| 254 |
"MessageArgs": [], |
| 255 |
"MessageId": "SYS043", |
| 256 |
"PercentComplete": 100, |
| 257 |
"TargetSettingsURI": null, |
| 258 |
"file": ".\\192.1.2.1_2023221_16301_scp.xml", |
| 259 |
"retval": true |
| 260 |
} |
| 261 |
}</td> |
| 262 |
<td>Module output of the Server Configuration Job</td> |
| 263 |
</tr> |
| 264 |
<tr> |
| 265 |
<td>share_type</td> |
| 266 |
<td>NFS</td> |
| 267 |
<td>Stores the share type sent as part of the role variables</td> |
| 268 |
</tr> |
| 269 |
</tbody> |
| 270 |
</table> |
| 271 |
|
| 272 |
## Examples |
| 273 |
----- |
| 274 |
|
| 275 |
``` |
| 276 |
- name: Exporting SCP local path with all components |
| 277 |
ansible.builtin.import_role: |
| 278 |
name: idrac_export_server_config_profile |
| 279 |
vars: |
| 280 |
idrac_ip: "192.1.2.1" |
| 281 |
idrac_user: "username" |
| 282 |
idrac_password: "password" |
| 283 |
ca_path: "/path/to/ca_cert.pem" |
| 284 |
share_parameters: |
| 285 |
share_name: "/root/tmp" |
| 286 |
scp_file: "file.xml" |
| 287 |
``` |
| 288 |
``` |
| 289 |
- name: "Exporting SCP to NFS with iDRAC components" |
| 290 |
ansible.builtin.import_role: |
| 291 |
name: "idrac_export_server_config_profile" |
| 292 |
vars: |
| 293 |
idrac_ip: "192.1.2.1" |
| 294 |
idrac_user: "username" |
| 295 |
idrac_password: "password" |
| 296 |
ca_path: "/path/to/ca_cert.pem" |
| 297 |
target: ['IDRAC'] |
| 298 |
share_parameters: |
| 299 |
share_name: "191.2.1.1:/nfs" |
| 300 |
scp_file: "file.json" |
| 301 |
``` |
| 302 |
``` |
| 303 |
- name: "Exporting SCP to CIFS with BIOS components" |
| 304 |
ansible.builtin.import_role: |
| 305 |
name: "idrac_export_server_config_profile" |
| 306 |
vars: |
| 307 |
idrac_ip: "192.1.2.1" |
| 308 |
idrac_user: "username" |
| 309 |
idrac_password: "password" |
| 310 |
ca_path: "/path/to/ca_cert.pem" |
| 311 |
target: ['BIOS'] |
| 312 |
share_parameters: |
| 313 |
share_name: "\\\\191.1.1.1\\cifs" |
| 314 |
share_user: "username" |
| 315 |
share_password: "password" |
| 316 |
scp_file: "file.xml" |
| 317 |
``` |
| 318 |
``` |
| 319 |
- name: "Exporting SCP to HTTPS with RAID components" |
| 320 |
ansible.builtin.import_role: |
| 321 |
name: "idrac_export_server_config_profile" |
| 322 |
vars: |
| 323 |
idrac_ip: "192.1.2.1" |
| 324 |
idrac_user: "username" |
| 325 |
idrac_password: "password" |
| 326 |
ca_path: "/path/to/ca_cert.pem" |
| 327 |
target: ['RAID'] |
| 328 |
share_parameters: |
| 329 |
share_name: "https://192.1.1.1/share" |
| 330 |
share_user: "username" |
| 331 |
share_password: "password" |
| 332 |
scp_file: "filename.json" |
| 333 |
``` |
| 334 |
``` |
| 335 |
- name: "Exporting SCP to HTTP with NIC components" |
| 336 |
ansible.builtin.import_role: |
| 337 |
name: "idrac_export_server_config_profile" |
| 338 |
vars: |
| 339 |
idrac_ip: "192.1.2.1" |
| 340 |
idrac_user: "username" |
| 341 |
idrac_password: "password" |
| 342 |
ca_path: "/path/to/ca_cert.pem" |
| 343 |
target: ['NIC'] |
| 344 |
share_parameters: |
| 345 |
share_name: "http://192.1.1.1/share" |
| 346 |
share_user: "username" |
| 347 |
share_password: "password" |
| 348 |
scp_file: "filename.xml" |
| 349 |
``` |
| 350 |
``` |
| 351 |
- name: Export SCP |
| 352 |
hosts: idrac |
| 353 |
roles: |
| 354 |
- role: idrac_export_server_config_profile |
| 355 |
``` |
| 356 |
|
| 357 |
## Author Information |
| 358 |
------------------ |
| 359 |
|
| 360 |
Dell Technologies <br> |
| 361 |
Abhishek Sinha ([email protected]) 2023 |