Compare commits

..

2 Commits

2 changed files with 14 additions and 13 deletions

View File

@ -2,4 +2,7 @@
host_key_checking=False host_key_checking=False
inventory=hosts inventory=hosts
roles_path=roles roles_path=roles
[ssh_connections]
#ssh_args= -o ServerAliveInterval=30 -o ControlMaster=auto -o ControlPersist=60s
pipelining=True pipelining=True

View File

@ -7,23 +7,21 @@
state: absent state: absent
become: yes become: yes
- name: Creo interfaccia esterna in NethServer - name: Removing old interfaces from db networks
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: Pulizia vecchie interfacce
shell: "/sbin/e-smith/db networks delete {{ item }}" shell: "/sbin/e-smith/db networks delete {{ item }}"
become: yes become: yes
with_items: with_items:
- eth0 - eth0
- eth1 - eth1
- name: Trigger interfaces configuration - name: Configuring new external interface
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" 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: 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"
become: yes become: yes
async: 30
poll: 0