Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mrlesmithjr/ansible-netplan
Ansible role to manage Netplan
https://github.com/mrlesmithjr/ansible-netplan
ansible ansible-role
Last synced: 5 days ago
JSON representation
Ansible role to manage Netplan
- Host: GitHub
- URL: https://github.com/mrlesmithjr/ansible-netplan
- Owner: mrlesmithjr
- License: mit
- Created: 2018-04-15T18:10:03.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-11-05T02:56:48.000Z (about 2 months ago)
- Last Synced: 2024-12-11T06:05:35.910Z (12 days ago)
- Topics: ansible, ansible-role
- Language: Jinja
- Size: 91.8 KB
- Stars: 132
- Watchers: 9
- Forks: 84
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
**Table of Contents** _generated with [DocToc](https://github.com/thlorenz/doctoc)_
- [ansible-netplan](#ansible-netplan)
- [Requirements](#requirements)
- [Role Variables](#role-variables)
- [Dependencies](#dependencies)
- [Example Playbook](#example-playbook)
- [License](#license)
- [Author Information](#author-information)# ansible-netplan
An [Ansible](https://www.ansible.com) role to manage [Netplan](https://netplan.io)
## Requirements
You probably want to run the role with `become: true`
## Role Variables
[defaults/main.yml](defaults/main.yml)
## Dependencies
## Example Playbook
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.```yaml
---
- hosts: ...your hosts...
any_errors_fatal: true
roles:
- role: mrlesmithjr.netplan
become: yes
# This role will do nothing unless netplan_enabled is true.
netplan_enabled: true
# This should point to an existing netplan configuration file
# on your system which this role will overwrite,
# or to a nonexistent file which netplan is aware of.
#
# 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.
# Configuration defined bellow will be written to the file defined
# above in `netplan_config_file`.
netplan_configuration:
network:
version: 2
ethernets:
enp28s0f7:
addresses:
- 10.11.12.99/24
```
## Using vaulted variables
Vault encrypted variables need to be defined outside the `netplan_configuration` variable to be evaluated.```yaml
netplan_configuration:
network:
version: 2
tunnels:
wg_test:
mode: wireguard
key: "{{ my_wireguard_private_key }}"
....my_wireguard_private_key: !vault |
31366530666465373834386563636465636135323562303866363333333865376330303130363162
....
```## License
MIT
## Author Information
Larry Smith Jr.
- [EverythingShouldBeVirtual](http://everythingshouldbevirtual.com)
- [@mrlesmithjr](https://www.twitter.com/mrlesmithjr)
-