|
211 | 211 | state: new
|
212 | 212 | register: test_ten
|
213 | 213 |
|
214 |
| -### |
215 |
| -# Bug 13876 in netbox-community/netbox |
216 |
| -### |
217 |
| - |
218 |
| -#- name: "10 - ASSERT" |
219 |
| -# assert: |
220 |
| -# that: |
221 |
| -# - test_ten is changed |
222 |
| -# - test_ten['diff']['before']['state'] == "absent" |
223 |
| -# - test_ten['diff']['after']['state'] == "present" |
224 |
| -# - test_ten['msg'] == "ip_address 10.10.0.1/16 created" |
225 |
| -# - test_ten['ip_address']['address'] == "10.10.0.1/16" |
226 |
| -# - test_ten['ip_address']['family'] == 4 |
227 |
| -# - test_ten['ip_address']['assigned_object_type'] == "dcim.interface" |
228 |
| -# - test_ten['ip_address']['assigned_object_id'] == 4 |
229 |
| - |
230 |
| -#- name: "11 - Create IP address on GigabitEthernet2 - test100 - State: present" |
231 |
| -# netbox.netbox.netbox_ip_address: |
232 |
| -# netbox_url: http://localhost:32768 |
233 |
| -# netbox_token: 0123456789abcdef0123456789abcdef01234567 |
234 |
| -# data: |
235 |
| -# family: 4 |
236 |
| -# prefix: 192.168.100.0/24 |
237 |
| -# assigned_object: |
238 |
| -# name: GigabitEthernet2 |
239 |
| -# device: test100 |
240 |
| -# state: present |
241 |
| -# register: test_eleven |
242 |
| - |
243 |
| -#- name: "11 - ASSERT" |
244 |
| -# assert: |
245 |
| -# that: |
246 |
| -# - test_eleven is changed |
247 |
| -# - test_eleven['diff']['before']['state'] == "absent" |
248 |
| -# - test_eleven['diff']['after']['state'] == "present" |
249 |
| -# - test_eleven['msg'] == "ip_address 192.168.100.2/24 created" |
250 |
| -# - test_eleven['ip_address']['address'] == "192.168.100.2/24" |
| 214 | +- name: "10 - ASSERT" |
| 215 | + assert: |
| 216 | + that: |
| 217 | + - test_ten is changed |
| 218 | + - test_ten['diff']['before']['state'] == "absent" |
| 219 | + - test_ten['diff']['after']['state'] == "present" |
| 220 | + - test_ten['msg'] == "ip_address 10.10.0.1/16 created" |
| 221 | + - test_ten['ip_address']['address'] == "10.10.0.1/16" |
| 222 | + - test_ten['ip_address']['family'] == 4 |
| 223 | + - test_ten['ip_address']['assigned_object_type'] == "dcim.interface" |
| 224 | + - test_ten['ip_address']['assigned_object_id'] == 4 |
| 225 | + |
| 226 | +- name: "11 - Create IP address on GigabitEthernet2 - test100 - State: present" |
| 227 | + netbox.netbox.netbox_ip_address: |
| 228 | + netbox_url: http://localhost:32768 |
| 229 | + netbox_token: 0123456789abcdef0123456789abcdef01234567 |
| 230 | + data: |
| 231 | + family: 4 |
| 232 | + prefix: 192.168.100.0/24 |
| 233 | + assigned_object: |
| 234 | + name: GigabitEthernet2 |
| 235 | + device: test100 |
| 236 | + state: present |
| 237 | + register: test_eleven |
251 | 238 |
|
252 |
| -#- name: "12 - Duplicate - 192.168.100.2/24 on interface" |
253 |
| -# netbox.netbox.netbox_ip_address: |
254 |
| -# netbox_url: http://localhost:32768 |
255 |
| -# netbox_token: 0123456789abcdef0123456789abcdef01234567 |
256 |
| -# data: |
257 |
| -# address: 192.168.100.2/24 |
258 |
| -# assigned_object: |
259 |
| -# name: GigabitEthernet2 |
260 |
| -# device: test100 |
261 |
| -# state: present |
262 |
| -# register: test_twelve |
| 239 | +- name: "11 - ASSERT" |
| 240 | + assert: |
| 241 | + that: |
| 242 | + - test_eleven is changed |
| 243 | + - test_eleven['diff']['before']['state'] == "absent" |
| 244 | + - test_eleven['diff']['after']['state'] == "present" |
| 245 | + - test_eleven['msg'] == "ip_address 192.168.100.2/24 created" |
| 246 | + - test_eleven['ip_address']['address'] == "192.168.100.2/24" |
263 | 247 |
|
264 |
| -#- name: "12 - ASSERT" |
265 |
| -# assert: |
266 |
| -# that: |
267 |
| -# - not test_twelve['changed'] |
268 |
| -# - test_twelve['msg'] == "ip_address 192.168.100.2/24 already exists" |
269 |
| -# - test_twelve['ip_address']['address'] == "192.168.100.2/24" |
270 |
| -# - test_twelve['ip_address']['assigned_object_type'] == "dcim.interface" |
271 |
| -# - test_twelve['ip_address']['assigned_object_id'] == 4 |
| 248 | +- name: "12 - Duplicate - 192.168.100.2/24 on interface" |
| 249 | + netbox.netbox.netbox_ip_address: |
| 250 | + netbox_url: http://localhost:32768 |
| 251 | + netbox_token: 0123456789abcdef0123456789abcdef01234567 |
| 252 | + data: |
| 253 | + address: 192.168.100.2/24 |
| 254 | + assigned_object: |
| 255 | + name: GigabitEthernet2 |
| 256 | + device: test100 |
| 257 | + state: present |
| 258 | + register: test_twelve |
272 | 259 |
|
273 |
| -#- name: "13 - Duplicate - 192.168.100.2/24" |
274 |
| -# netbox.netbox.netbox_ip_address: |
275 |
| -# netbox_url: http://localhost:32768 |
276 |
| -# netbox_token: 0123456789abcdef0123456789abcdef01234567 |
277 |
| -# data: |
278 |
| -# address: 192.168.100.2/24 |
279 |
| -# state: present |
280 |
| -# register: test_thirteen |
| 260 | +- name: "12 - ASSERT" |
| 261 | + assert: |
| 262 | + that: |
| 263 | + - not test_twelve['changed'] |
| 264 | + - test_twelve['msg'] == "ip_address 192.168.100.2/24 already exists" |
| 265 | + - test_twelve['ip_address']['address'] == "192.168.100.2/24" |
| 266 | + - test_twelve['ip_address']['assigned_object_type'] == "dcim.interface" |
| 267 | + - test_twelve['ip_address']['assigned_object_id'] == 4 |
281 | 268 |
|
282 |
| -#- name: "13 - ASSERT" |
283 |
| -# assert: |
284 |
| -# that: |
285 |
| -# - not test_thirteen['changed'] |
286 |
| -# - test_thirteen['msg'] == "ip_address 192.168.100.2/24 already exists" |
287 |
| -# - test_thirteen['ip_address']['address'] == "192.168.100.2/24" |
| 269 | +- name: "13 - Duplicate - 192.168.100.2/24" |
| 270 | + netbox.netbox.netbox_ip_address: |
| 271 | + netbox_url: http://localhost:32768 |
| 272 | + netbox_token: 0123456789abcdef0123456789abcdef01234567 |
| 273 | + data: |
| 274 | + address: 192.168.100.2/24 |
| 275 | + state: present |
| 276 | + register: test_thirteen |
288 | 277 |
|
| 278 | +- name: "13 - ASSERT" |
| 279 | + assert: |
| 280 | + that: |
| 281 | + - not test_thirteen['changed'] |
| 282 | + - test_thirteen['msg'] == "ip_address 192.168.100.2/24 already exists" |
| 283 | + - test_thirteen['ip_address']['address'] == "192.168.100.2/24" |
289 | 284 |
|
290 | 285 | - name: "14 - Create IP address on Eth0 - test100-vm - State: present"
|
291 | 286 | netbox.netbox.netbox_ip_address:
|
|
0 commit comments