start router config

This commit is contained in:
Kyle Isom 2023-04-16 00:57:36 +00:00
parent 12661d9cba
commit cc151e732a
3 changed files with 44 additions and 0 deletions

View File

@ -0,0 +1,2 @@
router_server: False

View File

@ -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

View File

@ -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