Updated vagrant provisioning for box 1.1.0. Little corrections to tasks for network configuration on setup playbook.

This commit is contained in:
Emiliano Vavassori 2015-09-06 14:51:36 +02:00
parent bf35227e2d
commit 76f02d966d
12 changed files with 74 additions and 31 deletions

View File

@ -0,0 +1,3 @@
---
extnic: wan0
intnic: lan0

View File

@ -7,7 +7,6 @@
- nethpkg
- include: reconfig_nic.yml
when: ansible_product_name == "VirtualBox"
tags:
- nethnic

View File

@ -1,9 +1,9 @@
- name: Configurazione scheda di rete esterna
shell: /sbin/e-smith/db networks setprop eth0 role red bootproto dhcp
shell: /sbin/e-smith/db networks setprop {{ extnic }} role red bootproto dhcp
sudo: yes
- name: Configurazione scheda di rete interna
shell: /sbin/e-smith/db networks setprop eth1 role green ipaddr {{ ansible_local.domain.serverip }} netmask {{ ansible_local.domain.servernetmask }}
shell: /sbin/e-smith/db networks setprop {{ intnic }} role green ipaddr {{ ansible_local.domain.serverip }} netmask {{ ansible_local.domain.servernetmask }}
sudo: yes
- name: Attivo configurazioni di rete

View File

@ -1,18 +1,13 @@
---
# Provisioning per vagrant.
- name: Verifico versione server - NethServer
shell: /sbin/e-smith/db configuration getprop sysconfig ProductName
register: chk_nethserver
ignore_errors: yes
- name: Preparazione pacchetti per compilazione RPM
yum: pkg="{{ item }}" state=present
with_items:
- '@Development tools'
- rpmdevtools
- yum-utils
- rpmlint
sudo: yes
- name: Configuro la scheda secondaria
shell: /sbin/e-smith/db networks setprop eth1 bootproto none device eth1 ipaddr 192.168.1.1 netmask 255.255.255.0 onboot yes role green
when: "'NethServer' in chk_nethserver.stdout"
sudo: yes
notify:
- interface update
- name: Aggiungo utente per compilazione pacchetti RPM
user:
name: makepkg
@ -21,16 +16,6 @@
state: present
sudo: yes
- name: Preparazione pacchetti per compilazione RPM
yum: pkg="{{ item }}" state=present
with_items:
- '@Development tools'
- libselinux-python
- rpmdevtools
- yum-utils
- rpmlint
sudo: yes
- name: Copia della chiave pubblica
authorized_key:
user: makepkg

View File

@ -0,0 +1,3 @@
---
- include: developuser.yml
tags: developuser

View File

@ -0,0 +1,3 @@
---
extnic: wan0
intnic: lan0

View File

@ -0,0 +1,4 @@
---
dependencies:
- role: selinux
tags: selinux

View File

@ -0,0 +1,3 @@
---
- include: rename-nic.yml
tags: rename-nic

View File

@ -0,0 +1,40 @@
---
# Cambio nome interfacce
- name: Rinomino interfaccia esterna
replace:
dest: /etc/udev/rules.d/70-persistent-net.rules
regexp: 'eth0'
replace: '{{ extnic }}'
sudo: 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 role red
sudo: yes
- name: Pulizia vecchia interfaccia esterna
shell: /sbin/e-smith/db networks delete eth0
sudo: yes
- name: Rinomino interfaccia interna
replace:
dest: /etc/udev/rules.d/70-persistent-net.rules
regexp: 'eth1'
replace: '{{ intnic }}'
sudo: 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 192.168.1.1 netmask 255.255.255.0 onboot yes role green
sudo: yes
- name: Pulizia vecchia interfaccia interna
shell: /sbin/e-smith/db networks delete eth1
sudo: 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
sudo: yes
- name: Segnalo il cambiamento a livello di interfacce
shell: /sbin/e-smith/signal-event interface-update
sudo: yes

View File

@ -0,0 +1,7 @@
---
# Installing selinux bindings as first step
- name: Installo bindings selinux per Python
yum:
name: libselinux-python
state: present
sudo: yes

View File

@ -1,4 +0,0 @@
---
- name: interface update
shell: /sbin/e-smith/signal-event interface-update
sudo: yes

View File

@ -2,5 +2,5 @@
# Vagrant provisioning playbook
- hosts: vagrant
roles:
- vagrant
sudo: yes
- rename-nic
- developuser