ansible/test/integration/targets/facts_linux_network/tasks/main.yml
Sam Doran e6bf202738
linux facts - return proper broadcast address (#64528)
* linux facts - return proper broadcast address

Check that the value being returned is actually a broadcast address

* Add tests

* Cleanup tests
2020-07-30 19:40:14 +02:00

18 lines
595 B
YAML

- block:
- name: Add IP to interface
command: ip address add 100.42.42.1/32 dev {{ ansible_facts.default_ipv4.interface }}
ignore_errors: yes
- name: Gather network facts
setup:
gather_subset: network
- name: Ensure broadcast is reported as empty
assert:
that:
- ansible_facts[ansible_facts['default_ipv4']['interface']]['ipv4_secondaries'][0]['broadcast'] == ''
always:
- name: Remove IP from interface
command: ip address delete 100.42.42.1/32 dev {{ ansible_facts.default_ipv4.interface }}
ignore_errors: yes