Hello,
I tried to configure proxmox with ansible.
In my workflow, I put on proxmox a interfaces.new
And after a simple:
But not working.
When I try manually ifreload -a:
This my pending configuration, waiting I click on apply configuration, but no, I want I by ansible
Any ideas?
Thanks
I tried to configure proxmox with ansible.
In my workflow, I put on proxmox a interfaces.new
Code:
# network interface settings; autogenerated
# Please do NOT modify this file directly, unless you know what
# you're doing.
#
# If you want to manage parts of the network configuration manually,
# please utilize the 'source' or 'source-directory' directives to do
# so.
# PVE will preserve these directives, but will NOT read its network
# configuration from sourced files, so do not attempt to move any of
# the PVE managed interfaces into external files!
auto lo
iface lo inet loopback
iface enp3s0 inet manual
auto vmbr0
iface vmbr0 inet static
address {{ pve_ip }}
netmask 255.255.255.0
gateway {{ ansible_default_ipv4.gateway }}
bridge-ports enp3s0
bridge-stp off
bridge-fd 0
auto vmbr1
iface vmbr1 inet static
address 10.0.0.1
netmask 24
bridge-ports none
bridge-stp off
bridge-fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s '10.0.0.0/24' -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '10.0.0.0/24' -o vmbr0 -j MASQUERADE
And after a simple:
Code:
- name : Proxmox Interfaces
shell: ifreload -a
But not working.
When I try manually ifreload -a:
Code:
root@pve:~# ifreload -a
warning: cmd '/bin/ip addr del 192.168.10.255/24 dev vmbr0' failed: returned 2 (RTNETLINK answers: Cannot assign requested address
)
This my pending configuration, waiting I click on apply configuration, but no, I want I by ansible
Code:
--- /etc/network/interfaces 2020-04-06 09:16:53.099999477 +0200
+++ /etc/network/interfaces.new 2020-04-06 15:06:45.757428183 +0200
@@ -1,3 +1,14 @@
+# network interface settings; autogenerated
+# Please do NOT modify this file directly, unless you know what
+# you're doing.
+#
+# If you want to manage parts of the network configuration manually,
+# please utilize the 'source' or 'source-directory' directives to do
+# so.
+# PVE will preserve these directives, but will NOT read its network
+# configuration from sourced files, so do not attempt to move any of
+# the PVE managed interfaces into external files!
+
auto lo
iface lo inet loopback
@@ -8,6 +19,18 @@
address 192.168.10.172
netmask 255.255.255.0
gateway 192.168.10.1
- bridge_ports enp3s0
- bridge_stp off
- bridge_fd 0
+ bridge-ports enp3s0
+ bridge-stp off
+ bridge-fd 0
+
+auto vmbr1
+iface vmbr1 inet static
+ address 10.0.0.1
+ netmask 24
+ bridge-ports none
+ bridge-stp off
+ bridge-fd 0
+
+ post-up echo 1 > /proc/sys/net/ipv4/ip_forward
+ post-up iptables -t nat -A POSTROUTING -s '10.0.0.0/24' -o vmbr0 -j MASQUERADE
+ post-down iptables -t nat -D POSTROUTING -s '10.0.0.0/24' -o vmbr0 -j MASQUERADE
Any ideas?
Thanks