Added legit stuff

This commit is contained in:
Pünkösd Marcell 2021-11-09 02:18:02 +01:00
parent 034e8ef0a7
commit f851f907d1
4 changed files with 87 additions and 2 deletions

View File

@ -4,8 +4,55 @@ all:
ansible_user: ubuntu ansible_user: ubuntu
hosts: hosts:
kube-master-luna: kube-master-luna:
legit_uplink:
interface: enp1s0
gateway: 192.168.100.1
address: 192.168.100.10
legit_cluster_network:
interface: enp8s0
address: 192.168.8.10
kube-worker-luna: kube-worker-luna:
legit_uplink:
interface: enp1s0
gateway: 192.168.100.1
address: 192.168.100.11
legit_cluster_network:
interface: enp8s0
address: 192.168.8.11
kube-master-mckay: kube-master-mckay:
legit_uplink:
interface: eth0
gateway: 192.168.69.254
address: 192.168.69.40
legit_cluster_network:
interface: eth1
address: 192.168.8.20
kube-worker-mckay: kube-worker-mckay:
legit_uplink:
interface: eth0
gateway: 192.168.69.254
address: 192.168.69.41
legit_cluster_network:
interface: eth1
address: 192.168.8.21
kube-master-woolsey: kube-master-woolsey:
kube-worker-woolsey: legit_uplink:
interface: eth0
gateway: 192.168.69.1
address: 192.168.69.30
legit_cluster_network:
interface: eth1
address: 192.168.8.30
kube-worker-woolsey:
legit_uplink:
interface: eth0
gateway: 192.168.69.1
address: 192.168.69.31
legit_cluster_network:
interface: eth1
address: 192.168.8.31

View File

@ -1,5 +1,10 @@
- name: "prepare vms for kmlabs-k8s-cluster" - name: "prepare vms for kmlabs-k8s-cluster"
hosts: all hosts: all
handlers:
- name: "netplanapply"
command: netplan apply
async: 45
poll: 0
tasks: tasks:
- name: "do apt stuff" - name: "do apt stuff"
@ -12,4 +17,7 @@
import_tasks: tasks/remove-snap.yaml import_tasks: tasks/remove-snap.yaml
- name: "clean motd" - name: "clean motd"
import_tasks: tasks/clean-motd.yaml import_tasks: tasks/clean-motd.yaml
- name: "setup networking"
import_tasks: tasks/static-networking.yaml

View File

@ -0,0 +1,15 @@
- name: "remove cloudinit config"
file:
path: /etc/netplan/50-cloud-init.yaml
state: absent
- name: "remove installer config"
file:
path: /etc/netplan/00-installer-config.yaml
state: absent
- name: "install static config"
template:
src: templates/netplan.yaml
dest: /etc/netplan/00-static.yaml
notify: netplanapply

15
templates/netplan.yaml Normal file
View File

@ -0,0 +1,15 @@
# {{ansible_managed}}
network:
version: 2
ethernets:
{{ legit_uplink.interface }}:
dhcp4: false
dhcp6: false
gateway4: {{ legit_uplink.gateway }}
addresses:
- "{{ legit_uplink.address }}/24"
{{ legit_cluster_network.interface }}:
dhcp4: false
dhcp6: false
addresses:
- "{{ legit_cluster_network.address }}/24"