Oefenweb.netplan
netplan
Set up netplan in Debian-like systems.
Requirements
netplan.io(will be installed)nplan(will be installed)
Variables
netplan_install[default:[]]: Additional packages to installnetplan_version[default:2]: Versionnetplan_renderer[default:networkd]: Renderernetplan_conf_file[default:config.yaml]: Config file name (relative tonetplan_conf_path)netplan_conf[default:'']: Config in yaml format as a string (to be parsed, formatted and written down tonetplan_conf_file)netplan_conf_purge[default:false]: Whether or not to purge all "other" config files
Dependencies
None
Example(s)
Simple
---
- hosts: all
roles:
- oefenweb.netplan
Vagrant
---
- hosts: all
roles:
- oefenweb.netplan
vars:
netplan_conf_file: 01-netcfg.yaml
netplan_conf: |
network:
version: {{ netplan_version }}
renderer: {{ netplan_renderer }}
ethernets:
{{ hostvars[inventory_hostname]['ansible_' + (ansible_interfaces | difference(['lo']) | sort | list | first)]['device'] }}:
dhcp4: true
{{ hostvars[inventory_hostname]['ansible_' + (ansible_interfaces | difference(['lo']) | sort | list | last)]['device'] }}:
addresses:
- {{ hostvars[inventory_hostname]['ansible_' + (ansible_interfaces | difference(['lo']) | sort | list | last)]['ipv4']['address'] }}/24
netplan_conf_purge: true
License
MIT
Author Information
Mischa ter Smitten (based on work of Lucas Harms)
Feedback, bug-reports, requests, ...
Are welcome!
Install
ansible-galaxy install Oefenweb.netplanLicense
mit
Downloads
110
Owner
