Updated vagrant provisioning for box 1.1.0. Little corrections to tasks for network configuration on setup playbook.
This commit is contained in:
parent
bf35227e2d
commit
76f02d966d
3
roles/nethcfg/defaults/main.yml
Normal file
3
roles/nethcfg/defaults/main.yml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
extnic: wan0
|
||||||
|
intnic: lan0
|
@ -7,7 +7,6 @@
|
|||||||
- nethpkg
|
- nethpkg
|
||||||
|
|
||||||
- include: reconfig_nic.yml
|
- include: reconfig_nic.yml
|
||||||
when: ansible_product_name == "VirtualBox"
|
|
||||||
tags:
|
tags:
|
||||||
- nethnic
|
- nethnic
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
- name: Configurazione scheda di rete esterna
|
- 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
|
sudo: yes
|
||||||
|
|
||||||
- name: Configurazione scheda di rete interna
|
- 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
|
sudo: yes
|
||||||
|
|
||||||
- name: Attivo configurazioni di rete
|
- name: Attivo configurazioni di rete
|
||||||
|
@ -1,18 +1,13 @@
|
|||||||
---
|
---
|
||||||
# Provisioning per vagrant.
|
- name: Preparazione pacchetti per compilazione RPM
|
||||||
- name: Verifico versione server - NethServer
|
yum: pkg="{{ item }}" state=present
|
||||||
shell: /sbin/e-smith/db configuration getprop sysconfig ProductName
|
with_items:
|
||||||
register: chk_nethserver
|
- '@Development tools'
|
||||||
ignore_errors: yes
|
- rpmdevtools
|
||||||
|
- yum-utils
|
||||||
|
- rpmlint
|
||||||
sudo: yes
|
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
|
- name: Aggiungo utente per compilazione pacchetti RPM
|
||||||
user:
|
user:
|
||||||
name: makepkg
|
name: makepkg
|
||||||
@ -21,16 +16,6 @@
|
|||||||
state: present
|
state: present
|
||||||
sudo: yes
|
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
|
- name: Copia della chiave pubblica
|
||||||
authorized_key:
|
authorized_key:
|
||||||
user: makepkg
|
user: makepkg
|
3
vagrant/roles/developuser/tasks/main.yml
Normal file
3
vagrant/roles/developuser/tasks/main.yml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
- include: developuser.yml
|
||||||
|
tags: developuser
|
3
vagrant/roles/rename-nic/defaults/main.yml
Normal file
3
vagrant/roles/rename-nic/defaults/main.yml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
extnic: wan0
|
||||||
|
intnic: lan0
|
4
vagrant/roles/rename-nic/meta/main.yml
Normal file
4
vagrant/roles/rename-nic/meta/main.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
dependencies:
|
||||||
|
- role: selinux
|
||||||
|
tags: selinux
|
3
vagrant/roles/rename-nic/tasks/main.yml
Normal file
3
vagrant/roles/rename-nic/tasks/main.yml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
- include: rename-nic.yml
|
||||||
|
tags: rename-nic
|
40
vagrant/roles/rename-nic/tasks/rename-nic.yml
Normal file
40
vagrant/roles/rename-nic/tasks/rename-nic.yml
Normal 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
|
7
vagrant/roles/selinux/tasks/main.yml
Normal file
7
vagrant/roles/selinux/tasks/main.yml
Normal 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
|
@ -1,4 +0,0 @@
|
|||||||
---
|
|
||||||
- name: interface update
|
|
||||||
shell: /sbin/e-smith/signal-event interface-update
|
|
||||||
sudo: yes
|
|
@ -2,5 +2,5 @@
|
|||||||
# Vagrant provisioning playbook
|
# Vagrant provisioning playbook
|
||||||
- hosts: vagrant
|
- hosts: vagrant
|
||||||
roles:
|
roles:
|
||||||
- vagrant
|
- rename-nic
|
||||||
sudo: yes
|
- developuser
|
||||||
|
Loading…
x
Reference in New Issue
Block a user