Changes to 6.9.

This commit is contained in:
Emiliano Vavassori 2017-06-01 21:38:55 +02:00
parent a18ce577f5
commit 638b753ee1
9 changed files with 40 additions and 45 deletions

8
Vagrantfile vendored
View File

@ -10,8 +10,8 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "nethserver-6.8"
config.vm.box_url = "http://vagrant.sys42.eu/nethserver-6.8"
config.vm.box = "syntaxerrormmm/nethserver-6.9"
config.vm.box_url = "http://vagrant.sys42.eu/nethserver-6.9"
config.vm.define "NethServer" do |nethserver|
end
config.vm.provider :virtualbox do |vb|
@ -127,7 +127,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
#
# chef.validation_client_name = "ORGNAME-validator"
config.vm.provision "ansible" do |ansible|
ansible.inventory_path = "vagrant/hosts"
ansible.playbook = "vagrant/vagrant.yml"
ansible.inventory_path = "provision_hosts"
ansible.playbook = "provision.yml"
end
end

View File

@ -2,4 +2,4 @@
# Vagrant provisioning playbook
- hosts: vagrant
roles:
- rename-nic
- rename-nic

View File

@ -0,0 +1,35 @@
---
# Cambio nome interfacce
- name: Removing old interface names
file:
path: /etc/udev/rules.d/70-persistent-net.rules
state: absent
become: yes
- name: Forcing recreation of {{ extnic }}
shell: "INTERFACE=eth0 MATCHADDR={{ ansible_eth0.macaddress }} INTERFACE_NAME={{ extnic }} /lib/udev/write_net_rules"
become: yes
- name: Forcing recreation of {{ intnic }}
shell: "INTERFACE=eth1 MATCHADDR={{ ansible_eth1.macaddress }} INTERFACE_NAME={{ intnic }} /lib/udev/write_net_rules"
become: yes
- name: Pulizia vecchie interfacce
shell: "/sbin/e-smith/db networks delete {{ item }}"
become: yes
with_items:
- 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.254.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"
become: yes

View File

@ -1,40 +0,0 @@
---
# Cambio nome interfacce
- name: Rinomino interfaccia esterna
replace:
dest: /etc/udev/rules.d/70-persistent-net.rules
regexp: 'eth0'
replace: '{{ extnic }}'
become: yes
- 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: Pulizia vecchia interfaccia esterna
shell: /sbin/e-smith/db networks delete eth0
become: yes
- name: Rinomino interfaccia interna
replace:
dest: /etc/udev/rules.d/70-persistent-net.rules
regexp: 'eth1'
replace: '{{ intnic }}'
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.254.1 netmask 255.255.255.0 onboot yes role green
become: yes
- name: Pulizia vecchia interfaccia interna
shell: /sbin/e-smith/db networks delete eth1
become: yes
# Forzo il processo a tornare zero, altrimenti non va.
- name: Ricreo le interfacce
shell: udevadm control --reload-rules && udevadm trigger --attr-match=subsystem=net
become: yes
- name: Segnalo il cambiamento a livello di interfacce
shell: /sbin/e-smith/signal-event interface-update
become: yes