28 lines
1.0 KiB
YAML
Raw Normal View History

2017-06-01 21:38:55 +02:00
---
# Cambio nome interfacce
- name: Removing old interface names
file:
path: /etc/udev/rules.d/70-persistent-net.rules
state: absent
become: yes
2018-11-11 01:39:15 +01:00
- name: Removing old interfaces from db networks
2017-06-01 21:38:55 +02:00
shell: "/sbin/e-smith/db networks delete {{ item }}"
become: yes
with_items:
- eth0
- eth1
2018-11-11 01:39:15 +01:00
- name: Configuring new external interface
shell: "/sbin/e-smith/db networks set {{ extnic }} ethernet bootproto dhcp device {{ extnic }} hwaddr {{ ansible_eth0.macaddress }} onboot yes role red"
2018-11-11 01:39:15 +01:00
become: yes
- name: Configuring new internal interface
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 change
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; /sbin/e-smith/signal-event firewall-adjust"
2017-06-01 21:38:55 +02:00
become: yes