This commit is contained in:
Nathaniel Case 2019-08-28 13:53:33 -04:00 committed by GitHub
parent b20bfc1048
commit 841d204d0d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 0 deletions

View file

@ -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():

View file

@ -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) == []"