38 lines
720 B
YAML
38 lines
720 B
YAML
|
- name: set up netplan
|
||
|
become: true
|
||
|
ansible.builtin.file:
|
||
|
content: |
|
||
|
network:
|
||
|
version: 2
|
||
|
ethernets:
|
||
|
eth0:
|
||
|
dhcp4: False
|
||
|
dhcp6: False
|
||
|
addresses:
|
||
|
- "192.168.4.254/24"
|
||
|
dest: /etc/netplan/20-router-eth0.yaml
|
||
|
mode: 0644
|
||
|
owner: root
|
||
|
group: root
|
||
|
|
||
|
- name: apply netplan
|
||
|
become: true
|
||
|
ansible.builtin.command:
|
||
|
cmd: netplan apply
|
||
|
|
||
|
- name: copy dnsmasq.conf
|
||
|
become: true
|
||
|
ansible.builtin.copy:
|
||
|
src: "{{ role_path }}/files/dnsmasq.conf"
|
||
|
dest: /etc/dnsmasq.conf
|
||
|
mode: 0644
|
||
|
owner: root
|
||
|
group: root
|
||
|
|
||
|
- name: install netmasq
|
||
|
become: true
|
||
|
ansible.builtin.apt:
|
||
|
name: dnsmasq
|
||
|
state: present
|
||
|
|