start router config
This commit is contained in:
parent
12661d9cba
commit
cc151e732a
|
@ -0,0 +1,2 @@
|
||||||
|
router_server: False
|
||||||
|
|
|
@ -3,3 +3,8 @@
|
||||||
ansible.builtin.apt: name={{ item }} state=present
|
ansible.builtin.apt: name={{ item }} state=present
|
||||||
with_items:
|
with_items:
|
||||||
- openssh-server
|
- openssh-server
|
||||||
|
|
||||||
|
- name: include router setup if tagged
|
||||||
|
when: router_server
|
||||||
|
ansible.builtin.include_tasks:
|
||||||
|
file: router.yaml
|
|
@ -0,0 +1,37 @@
|
||||||
|
- 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
|
||||||
|
|
Loading…
Reference in New Issue