mirror of https://github.com/ansible/ansible.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
595 B
YAML
19 lines
595 B
YAML
4 years ago
|
- 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
|