community.general.interfaces_file – Tweak settings in /etc/network/interfaces files¶
Note
This plugin is part of the community.general collection (version 2.5.1).
To install it use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.interfaces_file
.
Synopsis¶
Manage (add, remove, change) individual interface options in an interfaces-style file without having to manage the file as a whole with, say, ansible.builtin.template or ansible.builtin.assemble. Interface has to be presented in a file.
Read information about interfaces from interfaces-styled files
Parameters¶
Notes¶
Note
If option is defined multiple times last one will be updated but all will be deleted in case of an absent state
Examples¶
- name: Set eth1 mtu configuration value to 8000
community.general.interfaces_file:
dest: /etc/network/interfaces.d/eth1.cfg
iface: eth1
option: mtu
value: 8000
backup: yes
state: present
register: eth1_cfg
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Authors¶
Roman Belyakovsky (@hryamzik)