proxmox: standardize interface names and set up management VRF
No idea how badly this clashes with GUI configuration.
This commit is contained in:
parent
aae782a66b
commit
2330edf479
8 changed files with 94 additions and 6 deletions
5
roles/proxmox/templates/10-network.rules.j2
Normal file
5
roles/proxmox/templates/10-network.rules.j2
Normal file
|
@ -0,0 +1,5 @@
|
|||
{% for name in hwaddr %}
|
||||
{% for addr in hwaddr[name] %}
|
||||
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="{{ addr }}", NAME="{{ name }}{{ loop.index0 }}"
|
||||
{% endfor %}
|
||||
{% endfor %}
|
16
roles/proxmox/templates/interfaces.j2
Normal file
16
roles/proxmox/templates/interfaces.j2
Normal file
|
@ -0,0 +1,16 @@
|
|||
auto lo
|
||||
iface lo inet loopback
|
||||
|
||||
auto mgmt
|
||||
iface mgmt
|
||||
address 127.0.0.1/8
|
||||
address ::1/128
|
||||
vrf-table auto
|
||||
|
||||
auto {{ iface_mgmt }}
|
||||
iface {{ iface_mgmt }}
|
||||
vrf mgmt
|
||||
address {{ ansible_host }}/{{ mgmt_gw | ipaddr('prefix') }}
|
||||
gateway {{ mgmt_gw | ipaddr('address') }}
|
||||
|
||||
source /etc/network/interfaces.d/*
|
14
roles/proxmox/templates/sshd_config.mgmt.j2
Normal file
14
roles/proxmox/templates/sshd_config.mgmt.j2
Normal file
|
@ -0,0 +1,14 @@
|
|||
# This is for sshd in management VRF, for ansible and other not-really-OOB stuff.
|
||||
|
||||
PidFile none
|
||||
UsePAM no
|
||||
|
||||
# Only allow pubkey auth.
|
||||
KbdInteractiveAuthentication no
|
||||
PasswordAuthentication no
|
||||
PermitRootLogin prohibit-password
|
||||
|
||||
# Disable what we can.
|
||||
AllowTcpForwarding no
|
||||
GatewayPorts no
|
||||
X11Forwarding no
|
Loading…
Add table
Add a link
Reference in a new issue