pull/61485/head
Nathaniel Case 5 years ago committed by GitHub
parent b20bfc1048
commit 841d204d0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -197,6 +197,9 @@ class Vlans(ConfigBase):
def generate_commands(vlan_id, to_set, to_remove):
commands = []
for key, value in to_set.items():
if value is None:
continue
commands.append("{0} {1}".format(key, value))
for key in to_remove.keys():

@ -0,0 +1,21 @@
---
- eos_facts:
gather_network_resources: vlans
become: yes
- name: Ensures that facts are idempotent through replace
eos_vlans:
config: "{{ ansible_facts.network_resources.vlans }}"
state: replaced
register: result
become: yes
- eos_facts:
gather_network_resources: vlans
become: yes
- assert:
that:
- "result.changed == False"
- "result.commands == []"
- "ansible_facts.network_resources.vlans|symmetric_difference(result.before) == []"
Loading…
Cancel
Save