2021-09-19 13:44:37 +02:00
|
|
|
---
|
|
|
|
- name:
|
|
|
|
set_fact:
|
2021-09-21 08:16:42 +02:00
|
|
|
interfaces_testfile: '{{ remote_tmp_dir }}/interfaces'
|
2021-09-19 13:44:37 +02:00
|
|
|
|
|
|
|
- name: Copy interfaces file
|
|
|
|
copy:
|
|
|
|
src: 'files/interfaces_ff'
|
|
|
|
dest: '{{ interfaces_testfile }}'
|
|
|
|
|
|
|
|
- name: Change IP address to 1.2.3.5
|
|
|
|
community.general.interfaces_file:
|
|
|
|
dest: "{{ interfaces_testfile }}"
|
|
|
|
iface: eno1
|
|
|
|
option: address
|
|
|
|
value: 1.2.3.5
|
|
|
|
register: ifile_1
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- ifile_1 is changed
|
|
|
|
|
|
|
|
- name: Change IP address to 1.2.3.5 again
|
|
|
|
community.general.interfaces_file:
|
|
|
|
dest: "{{ interfaces_testfile }}"
|
|
|
|
iface: eno1
|
|
|
|
option: address
|
|
|
|
value: 1.2.3.5
|
|
|
|
register: ifile_2
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- ifile_2 is not changed
|