49
49
required: false
50
50
type: bool
51
51
version_added: 3.5.0
52
+ termination_id:
53
+ description:
54
+ - The ProviderNetwork, Location, Site, Region, or SiteGroup ID of the circuit termination will be assigned to.
55
+ - This parameter is used with NetBox versions >= 4.2.0.
56
+ required: false
57
+ type: int
58
+ version_added: 4.2.0
59
+ termination_type:
60
+ description:
61
+ - The type the circuit termination will be assigned to.
62
+ - This parameter is used with NetBox versions >= 4.2.0.
63
+ choices:
64
+ - dcim.site
65
+ - dcim.location
66
+ - dcim.region
67
+ - dcim.sitegroup
68
+ - circuits.providernetwork
69
+ required: false
70
+ type: str
71
+ version_added: 4.2.0
52
72
site:
53
73
description:
54
- - The site the circuit termination will be assigned to
74
+ - The site the circuit termination will be assigned to.
75
+ - This parameter is used with NetBox versions before 4.2.0.
55
76
required: false
56
77
type: raw
57
78
provider_network:
58
79
description:
59
- - The provider_network the circuit termination will be assigned to
80
+ - The provider_network the circuit termination will be assigned to.
81
+ - This parameter is used with NetBox versions before 4.2.0.
60
82
required: false
61
83
type: raw
62
84
port_speed:
93
115
gather_facts: false
94
116
95
117
tasks:
96
- - name: Create circuit termination within NetBox with only required information
118
+ - name: Create circuit termination within NetBox version 4.2.0 or later with only required information
119
+ netbox.netbox.netbox_circuit_termination:
120
+ netbox_url: http://netbox.local
121
+ netbox_token: thisIsMyToken
122
+ data:
123
+ circuit: Test Circuit
124
+ term_side: A
125
+ termination_id: 1
126
+ termination_type: dcim.site
127
+ port_speed: 10000
128
+ state: present
129
+
130
+ - name: Create circuit termination within NetBox versions earlier than 4.2.0 with only required information
97
131
netbox.netbox.netbox_circuit_termination:
98
132
netbox_url: http://netbox.local
99
133
netbox_token: thisIsMyToken
@@ -163,6 +197,18 @@ def main():
163
197
circuit = dict (required = True , type = "raw" ),
164
198
term_side = dict (required = True , choices = ["A" , "Z" ]),
165
199
mark_connected = dict (required = False , type = "bool" ),
200
+ termination_id = dict (required = False , type = "int" ),
201
+ termination_type = dict (
202
+ required = False ,
203
+ type = "str" ,
204
+ choices = [
205
+ "dcim.site" ,
206
+ "dcim.location" ,
207
+ "dcim.region" ,
208
+ "dcim.sitegroup" ,
209
+ "circuits.providernetwork" ,
210
+ ],
211
+ ),
166
212
site = dict (required = False , type = "raw" ),
167
213
provider_network = dict (required = False , type = "raw" ),
168
214
port_speed = dict (required = False , type = "int" ),
@@ -180,8 +226,18 @@ def main():
180
226
("state" , "absent" , ["circuit" , "term_side" ]),
181
227
]
182
228
229
+ mutually_exclusive = [
230
+ ("termination_id" , "site" ),
231
+ ("termination_type" , "site" ),
232
+ ("termination_id" , "provider_network" ),
233
+ ("termination_type" , "provider_network" ),
234
+ ]
235
+
183
236
module = NetboxAnsibleModule (
184
- argument_spec = argument_spec , supports_check_mode = True , required_if = required_if
237
+ argument_spec = argument_spec ,
238
+ supports_check_mode = True ,
239
+ required_if = required_if ,
240
+ mutually_exclusive = mutually_exclusive ,
185
241
)
186
242
187
243
netbox_circuit_termination = NetboxCircuitsModule (module , NB_CIRCUIT_TERMINATIONS )
0 commit comments