Now configuring magic-router as well
This commit is contained in:
parent
a306d9e56c
commit
35590f4e59
32
ansible/files/magic_router_netplan.yaml
Normal file
32
ansible/files/magic_router_netplan.yaml
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
network:
|
||||||
|
version: 2
|
||||||
|
ethernets:
|
||||||
|
|
||||||
|
# cloud
|
||||||
|
enp1s0f0:
|
||||||
|
dhcp4: false
|
||||||
|
dhcp6: false
|
||||||
|
gateway4: 192.168.110.1
|
||||||
|
addresses:
|
||||||
|
- "192.168.110.10/24"
|
||||||
|
|
||||||
|
# edge-1
|
||||||
|
enp1s0f1:
|
||||||
|
dhcp4: false
|
||||||
|
dhcp6: false
|
||||||
|
addresses:
|
||||||
|
- "192.168.111.10/24"
|
||||||
|
|
||||||
|
# edge-2
|
||||||
|
enp1s0f2:
|
||||||
|
dhcp4: false
|
||||||
|
dhcp6: false
|
||||||
|
addresses:
|
||||||
|
- "192.168.112.10/24"
|
||||||
|
|
||||||
|
# site
|
||||||
|
enp1s0f3:
|
||||||
|
dhcp4: false
|
||||||
|
dhcp6: false
|
||||||
|
addresses:
|
||||||
|
- "192.168.113.10/24"
|
@ -13,7 +13,6 @@ cloud-1:
|
|||||||
cloud-cluster-1-worker-1:
|
cloud-cluster-1-worker-1:
|
||||||
cloud-cluster-1-worker-2:
|
cloud-cluster-1-worker-2:
|
||||||
|
|
||||||
|
|
||||||
edge-1:
|
edge-1:
|
||||||
vars:
|
vars:
|
||||||
magic_router_ip: 192.168.111.10
|
magic_router_ip: 192.168.111.10
|
||||||
@ -56,9 +55,21 @@ site-1:
|
|||||||
hosts:
|
hosts:
|
||||||
site-emulator-1:
|
site-emulator-1:
|
||||||
|
|
||||||
all:
|
networking:
|
||||||
|
vars:
|
||||||
|
ansible_become: true
|
||||||
|
ansible_user: ubuntu
|
||||||
|
hosts:
|
||||||
|
magic-router:
|
||||||
|
|
||||||
|
kubernetes:
|
||||||
children:
|
children:
|
||||||
cloud-1:
|
cloud-1:
|
||||||
edge-1:
|
edge-1:
|
||||||
edge-2:
|
edge-2:
|
||||||
|
|
||||||
|
all:
|
||||||
|
children:
|
||||||
|
networking:
|
||||||
|
kubernetes:
|
||||||
site-1:
|
site-1:
|
||||||
|
@ -12,6 +12,10 @@
|
|||||||
state: restarted
|
state: restarted
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
|
|
||||||
|
- name: "fix dns"
|
||||||
|
import_tasks: tasks/fix-dns-resolution.yaml
|
||||||
|
|
||||||
- name: "do apt stuff"
|
- name: "do apt stuff"
|
||||||
import_tasks: tasks/apt.yaml
|
import_tasks: tasks/apt.yaml
|
||||||
|
|
||||||
@ -24,8 +28,9 @@
|
|||||||
- name: "clean motd"
|
- name: "clean motd"
|
||||||
import_tasks: tasks/clean-motd.yaml
|
import_tasks: tasks/clean-motd.yaml
|
||||||
|
|
||||||
- name: "fix dns"
|
|
||||||
import_tasks: tasks/fix-dns-resolution.yaml
|
|
||||||
|
|
||||||
- name: "setup static route"
|
- name: "setup static route"
|
||||||
import_tasks: tasks/setup-static-route.yaml
|
import_tasks: tasks/setup-static-route.yaml
|
||||||
|
|
||||||
|
- name: "setup router stuff"
|
||||||
|
import_tasks: tasks/enable-routing.yaml
|
||||||
|
when: ansible_host == "magic-router"
|
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
- name: "Install my favourite applications"
|
- name: "Install my favourite applications"
|
||||||
apt:
|
apt:
|
||||||
|
update_cache: true
|
||||||
state: present
|
state: present
|
||||||
name:
|
name:
|
||||||
- tmux
|
- tmux
|
||||||
|
6
ansible/tasks/enable-routing.yaml
Normal file
6
ansible/tasks/enable-routing.yaml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
- name: enable routing in sysctl config
|
||||||
|
ansible.posix.sysctl:
|
||||||
|
name: net.ipv4.ip_forward
|
||||||
|
value: 1
|
||||||
|
state: present
|
||||||
|
reload: true
|
@ -8,3 +8,11 @@
|
|||||||
src: templates/netplan.yaml
|
src: templates/netplan.yaml
|
||||||
dest: /etc/netplan/00-static.yaml
|
dest: /etc/netplan/00-static.yaml
|
||||||
notify: netplanapply
|
notify: netplanapply
|
||||||
|
when: ansible_host != "magic-router"
|
||||||
|
|
||||||
|
- name: "install static config for magic router"
|
||||||
|
copy:
|
||||||
|
src: files/magic_router_netplan.yaml
|
||||||
|
dest: /etc/netplan/00-static.yaml
|
||||||
|
notify: netplanapply
|
||||||
|
when: ansible_host == "magic-router"
|
Loading…
Reference in New Issue
Block a user