Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mvladislav/ansible-netplan
ansible-role to setup netplan
https://github.com/mvladislav/ansible-netplan
ansible-role linux netplan ubuntu
Last synced: 2 months ago
JSON representation
ansible-role to setup netplan
- Host: GitHub
- URL: https://github.com/mvladislav/ansible-netplan
- Owner: MVladislav
- License: mit
- Created: 2021-07-07T02:11:18.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-07-26T22:41:15.000Z (6 months ago)
- Last Synced: 2024-07-26T23:46:22.014Z (6 months ago)
- Topics: ansible-role, linux, netplan, ubuntu
- Language: Jinja
- Homepage:
- Size: 54.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# Netplan
[![Ansible Lint](https://github.com/MVladislav/ansible-netplan/actions/workflows/ansible-lint.yml/badge.svg)](https://github.com/MVladislav/ansible-netplan/actions/workflows/ansible-lint.yml)
[![Ansible Molecule Test](https://github.com/MVladislav/ansible-netplan/actions/workflows/ci.yml/badge.svg)](https://github.com/MVladislav/ansible-netplan/actions/workflows/ci.yml)- [Netplan](#netplan)
- [Role Variables](#role-variables)
- [Dependencies](#dependencies)
- [Example Playbook](#example-playbook)
- [License](#license)---
You can checkout [MVladislav - ansible-env-setup - playbooks](https://github.com/MVladislav/ansible-env-setup/tree/main/playbooks) for how i use it in general.
Tested with:
- Ubuntu 23.04
## Role Variables
```yml
netplan_install: no
netplan_remove_existing: no
netplan_service_name: default# NetworkManager | networkd
netplan_renderer: networkd
netplan_version: 2netplan_dir: /etc/netplan
netplan_file: "00-{{ netplan_service_name }}.yaml"# for template
netplan_configuration:
network:
ethernets:
eth0:
dhcp4: yes
dhcp6: no
addresses:
- "{{ ansible_default_ipv4.address }}/24"
nameservers:
addresses:
- 1.1.1.1
- 1.0.0.1
search:
- localdomain
routes:
- to: default
via: "{{ ansible_default_ipv4.address.split('.')[0:3] | join('.') }}.1"
```## Dependencies
Developed and testes with Ansible 2.14.4
## Example Playbook
```yml
- hosts: clients
roles:
- role: netplan
netplan_remove_existing: no
netplan_service_name: default
netplan_renderer: networkd
netplan_version: 2
netplan_dir: /etc/netplan
netplan_file: "00-{{ netplan_service_name }}.yaml"
netplan_configuration:
network:
ethernets:
eth0:
dhcp4: yes
dhcp6: no
addresses:
- "{{ ansible_host }}/24"
nameservers:
addresses:
- 1.1.1.1
- 1.0.0.1
gateway4: "{{ ansible_host.split('.')[0:3] | join('.') }}.1"
```## License
MIT