First try in renaming interfaces.

This commit is contained in:
Emiliano Vavassori 2018-11-10 21:02:29 +01:00
parent dc57a5639b
commit daf8badd85

View File

@ -7,12 +7,12 @@
state: absent
become: yes
- name: Forcing recreation of {{ extnic }}
shell: "INTERFACE=eth0 MATCHADDR={{ ansible_eth0.macaddress }} INTERFACE_NAME={{ extnic }} /lib/udev/write_net_rules"
- name: Creo interfaccia esterna in NethServer
shell: /sbin/e-smith/db networks set {{ extnic }} ethernet bootproto dhcp device {{ extnic }} hwaddr {{ ansible_eth0.macaddress }} onboot yes peerdns yes role red
become: yes
- name: Forcing recreation of {{ intnic }}
shell: "INTERFACE=eth1 MATCHADDR={{ ansible_eth1.macaddress }} INTERFACE_NAME={{ intnic }} /lib/udev/write_net_rules"
- name: Creo interfaccia interna in NethServer
shell: /sbin/e-smith/db networks set {{ intnic }} ethernet bootproto none device {{ intnic }} hwaddr {{ ansible_eth1.macaddress }} ipaddr 172.16.253.1 netmask 255.255.255.0 onboot yes role green
become: yes
- name: Pulizia vecchie interfacce
@ -22,14 +22,8 @@
- eth0
- eth1
- name: Creo interfaccia esterna in NethServer
shell: /sbin/e-smith/db networks set {{ extnic }} ethernet bootproto dhcp device {{ extnic }} hwaddr {{ ansible_eth0.macaddress }} onboot yes peerdns yes role red
become: yes
- name: Creo interfaccia interna in NethServer
shell: /sbin/e-smith/db networks set {{ intnic }} ethernet bootproto none device {{ intnic }} hwaddr {{ ansible_eth1.macaddress }} ipaddr 172.16.253.1 netmask 255.255.255.0 onboot yes role green
become: yes
- name: Trigger interfaces configuration
shell: "ifdown eth0; ifdown eth1; udevadm control --reload-rules && udevadm trigger; /sbin/e-smith/signal-event interface-update"
shell: "ip link set eth0 down; ip link set eth0 name {{ extnic }}; ip link set eth1 down; ip link set eth1 name {{ intnic }}; /sbin/e-smith/signal-event interface-update"
become: yes
async: 30
poll: 0