Compare commits

...

4 Commits

18 changed files with 68 additions and 79 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 = "https://vagrant.libreschool.org/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

@ -1,31 +1,25 @@
---
# Configurazione dominio
ntpserver: pdc.topolin.ia
ntpserver: pdc.mastri.edu
server: pdc
serverip: 172.16.254.1
serverip: 192.168.1.1
servernetmask: 255.255.255.0
servernet: 172.16.254.0
servergw: 172.16.254.1
serverfqdn: pdc.topolin.ia
domainshort: TOPOLIN
domainfull: topolin.ia
dhcprange_start: 172.16.254.10
dhcprange_end: 172.16.254.50
servernet: 192.168.1.0
servergw: 192.168.1.1
serverfqdn: pdc.mastri.edu
domainshort: MASTRI
domainfull: mastri.edu
dhcprange_start: 192.168.1.10
dhcprange_end: 192.168.1.50
extdnsserver1: 208.67.222.222
extdnsserver2: 208.67.220.220
org_email: info@bglug.it
org_company: Accademia di SuperPippo
org_countrycode: IA
org_company: Istituto Comprensivo 'Mastri Caravaggini'
org_countrycode: IT
org_department: "Laboratorio 1"
org_city: Topolinia
org_phone: "313 113 176-167"
org_street: "Piazza la bomba e scappa"
edu_package: secondary
mirror_mode: remote
#mirror_nfs_share: 192.168.255.1:/var/spool/apt-mirror/mirror
mirror_host: it.archive.ubuntu.com
#mirror_path: /ubuntu
#mirror_security_host: security.ubuntu.com
#mirror_security_path: /ubuntu
client_gitbranch: master
#client_gitrepo: "https://github.com/bglug-it/client-pull-installation.git"
org_city: Caravaggio
org_phone: "+39 0363 50598"
org_street: "Via Zenale e Butinone, 20"
mirror_mode: local
#remote_mirror: ubuntu.fastbull.org
client_gitbranch: caravaggio

2
hosts
View File

@ -2,4 +2,4 @@
host_key_checking=false
[server]
172.16.254.1 ansible_ssh_user=amgmt
192.168.1.1 ansible_ssh_user=amgmt

View File

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

View File

@ -5,7 +5,7 @@
comment: "Ansible Management User"
group: wheel
state: present
password: $6$mVKMBMbAxeql$eqSe8tu2qKjtwmpiFy07b6nv2g4F80N.U9EzOmQTrNZwKZ61n6NLrSEQHQo1FOlQghOiB8as6Z35oTUUKN8y2.
password: $6$rounds=100000$XvHuMoXtpCksx379$nhlfUn38.oBB7JrDrtwfUisw8T0Bg5InzFq1fw31mcEmGZ2AYFkFK2zC2g04lSfw.kpdSgqH3Dl5q9r1fY6.k.
- name: Concessione diritti all'utente di gestione Ansible
template:

View File

@ -86,12 +86,12 @@
register: chk_shared
- name: Copying default templates for shared template type
shell: cp -r /etc/e-smith/templates/etc/samba/smb.conf/ibay-default /etc/e-smith/templates-custom/etc/samba/smb.conf/ibay-shared
shell: cp -r /etc/e-smith/templates/etc/samba/smb.conf/ibay-default /etc/e-smith/templates/etc/samba/smb.conf/ibay-shared
when: force_ibay_shared|bool or chk_shared|failed
- name: Configuring ibay-shared template structure (directory mask)
lineinfile:
dest: /etc/e-smith/templates-custom/etc/samba/smb.conf/ibay-shared/20profile_default
dest: /etc/e-smith/templates/etc/samba/smb.conf/ibay-shared/20profile_default
line: 'directory mask = 0775'
insertafter: '^create mask'
state: present
@ -99,7 +99,7 @@
- name: Configuring force create mode
lineinfile:
dest: /etc/e-smith/templates-custom/etc/samba/smb.conf/ibay-shared/20profile_default
dest: /etc/e-smith/templates/etc/samba/smb.conf/ibay-shared/20profile_default
line: 'force create mode = 0664'
insertafter: '^directory mask'
state: present
@ -107,7 +107,7 @@
- name: Configuring force directory mode
lineinfile:
dest: /etc/e-smith/templates-custom/etc/samba/smb.conf/ibay-shared/20profile_default
dest: /etc/e-smith/templates/etc/samba/smb.conf/ibay-shared/20profile_default
line: 'force directory mode = 0775'
insertafter: '^force create mode'
state: present

View File

@ -66,7 +66,7 @@ d-i clock-setup/ntp-server string {{ ansible_local.domain.ntpserver }}
# User creation
d-i passwd/user-fullname string BgLUG User
d-i passwd/username string bglug
d-i passwd/user-password-crypted password $6$S8u22loyR$RJZUtmnqmadvas13BxjPkBjdcF1o6P0xGtweZ9MkUCKIbyzmzQFxvwPTwoX1AaPgRyNmvdevyUgs/AMRGH8O./
d-i passwd/user-password-crypted string $1$33bB/LIt$MEHmvzVIgYRJs/5L4z34L/
# Partitioning
d-i partman-auto/init_automatically_partition select biggest_free

View File

@ -66,7 +66,7 @@ d-i clock-setup/ntp-server string {{ ansible_local.domain.ntpserver }}
# User creation
d-i passwd/user-fullname string BgLUG User
d-i passwd/username string bglug
d-i passwd/user-password-crypted password $6$S8u22loyR$RJZUtmnqmadvas13BxjPkBjdcF1o6P0xGtweZ9MkUCKIbyzmzQFxvwPTwoX1AaPgRyNmvdevyUgs/AMRGH8O./
d-i passwd/user-password-crypted string $1$33bB/LIt$MEHmvzVIgYRJs/5L4z34L/
# Partitioning
d-i partman-auto/init_automatically_partition select biggest_free

View File

@ -62,7 +62,7 @@ d-i clock-setup/ntp-server string {{ ansible_local.domain.ntpserver }}
# User creation
d-i passwd/user-fullname string BgLUG User
d-i passwd/username string bglug
d-i passwd/user-password-crypted password $6$S8u22loyR$RJZUtmnqmadvas13BxjPkBjdcF1o6P0xGtweZ9MkUCKIbyzmzQFxvwPTwoX1AaPgRyNmvdevyUgs/AMRGH8O./
d-i passwd/user-password-crypted string $1$33bB/LIt$MEHmvzVIgYRJs/5L4z34L/
# Partitioning
d-i partman-auto/init_automatically_partition select biggest_free

View File

@ -62,7 +62,7 @@ d-i clock-setup/ntp-server string {{ ansible_local.domain.ntpserver }}
# User creation
d-i passwd/user-fullname string BgLUG User
d-i passwd/username string bglug
d-i passwd/user-password-crypted password $6$S8u22loyR$RJZUtmnqmadvas13BxjPkBjdcF1o6P0xGtweZ9MkUCKIbyzmzQFxvwPTwoX1AaPgRyNmvdevyUgs/AMRGH8O./
d-i passwd/user-password-crypted string $1$33bB/LIt$MEHmvzVIgYRJs/5L4z34L/
# Partitioning
d-i partman-auto/init_automatically_partition select biggest_free

View File

@ -66,7 +66,7 @@ d-i clock-setup/ntp-server string {{ ansible_local.domain.ntpserver }}
# User creation
d-i passwd/user-fullname string BgLUG User
d-i passwd/username string bglug
d-i passwd/user-password-crypted password $6$S8u22loyR$RJZUtmnqmadvas13BxjPkBjdcF1o6P0xGtweZ9MkUCKIbyzmzQFxvwPTwoX1AaPgRyNmvdevyUgs/AMRGH8O./
d-i passwd/user-password-crypted string $1$33bB/LIt$MEHmvzVIgYRJs/5L4z34L/
# Partitioning
d-i partman-auto/init_automatically_partition select biggest_free

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