Table of Contents generated with DocToc
An Ansible role to manage Netplan
You probably want to run the role with become: true
The following is a trivial example of a playbook that sets a single network interface. See defaults/main.yml for a full list of values that can be set for this role.
---
- hosts: ...your hosts...
any_errors_fatal: true
roles:
- role: ansible-netplan
become: yes
# This role will do nothing unless netplan_enabled is true.
netplan_enabled: true
# The default is /etc/netplan/config.yaml.
netplan_config_file: /etc/netplan/my-awesome-netplan.yaml
# Ubuntu 18.04, for example, defaults to using networkd.
netplan_renderer: networkd
# Simple network configuration to add a single network
# interface.
netplan_configuration:
network:
version: 2
ethernets:
enp28s0f7:
addresses:
- 10.11.12.99/24
MIT
Larry Smith Jr.