| 1 |
.. _ome_network_vlan_module: |
| 2 |
|
| 3 |
|
| 4 |
ome_network_vlan -- Create, modify & delete a VLAN |
| 5 |
================================================== |
| 6 |
|
| 7 |
.. contents:: |
| 8 |
:local: |
| 9 |
:depth: 1 |
| 10 |
|
| 11 |
|
| 12 |
Synopsis |
| 13 |
-------- |
| 14 |
|
| 15 |
This module allows to, |
| 16 |
|
| 17 |
Create a VLAN on OpenManage Enterprise. |
| 18 |
|
| 19 |
Modify or delete an existing VLAN on OpenManage Enterprise. |
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
Requirements |
| 24 |
------------ |
| 25 |
The below requirements are needed on the host that executes this module. |
| 26 |
|
| 27 |
- python \>= 3.9.6 |
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
Parameters |
| 32 |
---------- |
| 33 |
|
| 34 |
state (optional, str, present) |
| 35 |
\ :literal:`present`\ creates a new VLAN or modifies an existing VLAN. |
| 36 |
|
| 37 |
\ :literal:`absent`\ deletes an existing VLAN. |
| 38 |
|
| 39 |
\ :emphasis:`WARNING`\ Deleting a VLAN can impact the network infrastructure. |
| 40 |
|
| 41 |
|
| 42 |
name (True, str, None) |
| 43 |
Provide the \ :emphasis:`name`\ of the VLAN to be created, deleted or modified. |
| 44 |
|
| 45 |
|
| 46 |
new_name (optional, str, None) |
| 47 |
Provide the \ :emphasis:`name`\ of the VLAN to be modified. |
| 48 |
|
| 49 |
|
| 50 |
description (optional, str, None) |
| 51 |
Short description of the VLAN to be created or modified. |
| 52 |
|
| 53 |
|
| 54 |
vlan_minimum (optional, int, None) |
| 55 |
The minimum VLAN value of the range. |
| 56 |
|
| 57 |
|
| 58 |
vlan_maximum (optional, int, None) |
| 59 |
The maximum VLAN value of the range. |
| 60 |
|
| 61 |
A single value VLAN is created if the vlan\_maximum and vlan\_minmum values are the same. |
| 62 |
|
| 63 |
|
| 64 |
type (optional, str, None) |
| 65 |
Types of supported VLAN networks. |
| 66 |
|
| 67 |
For the description of each network type, use API \ https://I(hostname\ /api/NetworkConfigurationService/NetworkTypes). |
| 68 |
|
| 69 |
|
| 70 |
hostname (True, str, None) |
| 71 |
OpenManage Enterprise or OpenManage Enterprise Modular IP address or hostname. |
| 72 |
|
| 73 |
|
| 74 |
username (False, str, None) |
| 75 |
OpenManage Enterprise or OpenManage Enterprise Modular username. |
| 76 |
|
| 77 |
If the username is not provided, then the environment variable \ :envvar:`OME\_USERNAME`\ is used. |
| 78 |
|
| 79 |
Example: export OME\_USERNAME=username |
| 80 |
|
| 81 |
|
| 82 |
password (False, str, None) |
| 83 |
OpenManage Enterprise or OpenManage Enterprise Modular password. |
| 84 |
|
| 85 |
If the password is not provided, then the environment variable \ :envvar:`OME\_PASSWORD`\ is used. |
| 86 |
|
| 87 |
Example: export OME\_PASSWORD=password |
| 88 |
|
| 89 |
|
| 90 |
x_auth_token (False, str, None) |
| 91 |
Authentication token. |
| 92 |
|
| 93 |
If the x\_auth\_token is not provided, then the environment variable \ :envvar:`OME\_X\_AUTH\_TOKEN`\ is used. |
| 94 |
|
| 95 |
Example: export OME\_X\_AUTH\_TOKEN=x\_auth\_token |
| 96 |
|
| 97 |
|
| 98 |
port (optional, int, 443) |
| 99 |
OpenManage Enterprise or OpenManage Enterprise Modular HTTPS port. |
| 100 |
|
| 101 |
|
| 102 |
validate_certs (optional, bool, True) |
| 103 |
If \ :literal:`false`\ , the SSL certificates will not be validated. |
| 104 |
|
| 105 |
Configure \ :literal:`false`\ only on personally controlled sites where self-signed certificates are used. |
| 106 |
|
| 107 |
Prior to collection version \ :literal:`5.0.0`\ , the \ :emphasis:`validate\_certs`\ is \ :literal:`false`\ by default. |
| 108 |
|
| 109 |
|
| 110 |
ca_path (optional, path, None) |
| 111 |
The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. |
| 112 |
|
| 113 |
|
| 114 |
timeout (optional, int, 30) |
| 115 |
The socket level timeout in seconds. |
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
|
| 120 |
|
| 121 |
Notes |
| 122 |
----- |
| 123 |
|
| 124 |
.. note:: |
| 125 |
- Run this module from a system that has direct access to Dell OpenManage Enterprise. |
| 126 |
- This module supports \ :literal:`check\_mode`\ . |
| 127 |
|
| 128 |
|
| 129 |
|
| 130 |
|
| 131 |
Examples |
| 132 |
-------- |
| 133 |
|
| 134 |
.. code-block:: yaml+jinja |
| 135 |
|
| 136 |
|
| 137 |
--- |
| 138 |
- name: Create a VLAN range |
| 139 |
dellemc.openmanage.ome_network_vlan: |
| 140 |
hostname: "{{hostname}}" |
| 141 |
username: "{{username}}" |
| 142 |
password: "{{password}}" |
| 143 |
ca_path: "/path/to/ca_cert.pem" |
| 144 |
state: present |
| 145 |
name: "vlan1" |
| 146 |
description: "VLAN desc" |
| 147 |
type: "General Purpose (Bronze)" |
| 148 |
vlan_minimum: 35 |
| 149 |
vlan_maximum: 40 |
| 150 |
tags: create_vlan_range |
| 151 |
|
| 152 |
- name: Create a VLAN with a single value |
| 153 |
dellemc.openmanage.ome_network_vlan: |
| 154 |
hostname: "{{hostname}}" |
| 155 |
username: "{{username}}" |
| 156 |
password: "{{password}}" |
| 157 |
ca_path: "/path/to/ca_cert.pem" |
| 158 |
state: present |
| 159 |
name: "vlan2" |
| 160 |
description: "VLAN desc" |
| 161 |
type: "General Purpose (Bronze)" |
| 162 |
vlan_minimum: 127 |
| 163 |
vlan_maximum: 127 |
| 164 |
tags: create_vlan_single |
| 165 |
|
| 166 |
- name: Modify a VLAN |
| 167 |
dellemc.openmanage.ome_network_vlan: |
| 168 |
hostname: "{{hostname}}" |
| 169 |
username: "{{username}}" |
| 170 |
password: "{{password}}" |
| 171 |
ca_path: "/path/to/ca_cert.pem" |
| 172 |
state: present |
| 173 |
name: "vlan1" |
| 174 |
new_name: "vlan_gold1" |
| 175 |
description: "new description" |
| 176 |
type: "General Purpose (Gold)" |
| 177 |
vlan_minimum: 45 |
| 178 |
vlan_maximum: 50 |
| 179 |
tags: modify_vlan |
| 180 |
|
| 181 |
- name: Delete a VLAN |
| 182 |
dellemc.openmanage.ome_network_vlan: |
| 183 |
hostname: "{{hostname}}" |
| 184 |
username: "{{username}}" |
| 185 |
password: "{{password}}" |
| 186 |
ca_path: "/path/to/ca_cert.pem" |
| 187 |
state: "absent" |
| 188 |
name: "vlan1" |
| 189 |
tags: delete_vlan |
| 190 |
|
| 191 |
|
| 192 |
|
| 193 |
Return Values |
| 194 |
------------- |
| 195 |
|
| 196 |
msg (always, str, Successfully created the VLAN.) |
| 197 |
Overall status of the VLAN operation. |
| 198 |
|
| 199 |
|
| 200 |
vlan_status (when I(state=present), dict, {'@odata.context': '/api/$metadata#NetworkConfigurationService.Network', '@odata.type': '#NetworkConfigurationService.Network', '@odata.id': '/api/NetworkConfigurationService/Networks(1234)', 'Id': 1234, 'Name': 'vlan1', 'Description': 'VLAN description', 'VlanMaximum': 130, 'VlanMinimum': 140, 'Type': 1, 'CreatedBy': 'admin', 'CreationTime': '2020-01-01 05:54:36.113', 'UpdatedBy': None, 'UpdatedTime': '2020-01-01 05:54:36.113', 'InternalRefNWUUId': '6d6effcc-eca4-44bd-be07-1234ab5cd67e'}) |
| 201 |
Details of the VLAN that is either created or modified. |
| 202 |
|
| 203 |
|
| 204 |
error_info (on HTTP error, dict, {'code': 'Base.1.0.GeneralError', 'message': 'A general error has occurred. See ExtendedInfo for more information.', '@Message.ExtendedInfo': [{'MessageId': 'CTEM1043', 'RelatedProperties': [], 'Message': 'Unable to create or update the network because the entered VLAN minimum 0 is not within a valid range ( 1 - 4000 or 4021 - 4094 ).', 'MessageArgs': ['0', '1', '4000', '4021', '4094'], 'Severity': 'Warning', 'Resolution': 'Enter a valid VLAN minimum as identified in the message and retry the operation.'}]}) |
| 205 |
Details of the HTTP Error. |
| 206 |
|
| 207 |
|
| 208 |
|
| 209 |
|
| 210 |
|
| 211 |
Status |
| 212 |
------ |
| 213 |
|
| 214 |
|
| 215 |
|
| 216 |
|
| 217 |
|
| 218 |
Authors |
| 219 |
~~~~~~~ |
| 220 |
|
| 221 |
- Jagadeesh N V(@jagadeeshnv) |
| 222 |
- Meenakshi Dembi(@meenakshidembi691) |