Compare commits
4 Commits
master
...
caravaggio
Author | SHA1 | Date | |
---|---|---|---|
|
d1dd476288 | ||
00f3f60d52 | |||
00fdd10821 | |||
c52a680f3f |
8
Vagrantfile
vendored
8
Vagrantfile
vendored
@ -10,8 +10,8 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
|||||||
# please see the online documentation at vagrantup.com.
|
# please see the online documentation at vagrantup.com.
|
||||||
|
|
||||||
# Every Vagrant virtual environment requires a box to build off of.
|
# Every Vagrant virtual environment requires a box to build off of.
|
||||||
config.vm.box = "nethserver-6.8"
|
config.vm.box = "syntaxerrormmm/nethserver-6.9"
|
||||||
config.vm.box_url = "http://vagrant.sys42.eu/nethserver-6.8"
|
config.vm.box_url = "https://vagrant.libreschool.org/nethserver-6.9"
|
||||||
config.vm.define "NethServer" do |nethserver|
|
config.vm.define "NethServer" do |nethserver|
|
||||||
end
|
end
|
||||||
config.vm.provider :virtualbox do |vb|
|
config.vm.provider :virtualbox do |vb|
|
||||||
@ -127,7 +127,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
|||||||
#
|
#
|
||||||
# chef.validation_client_name = "ORGNAME-validator"
|
# chef.validation_client_name = "ORGNAME-validator"
|
||||||
config.vm.provision "ansible" do |ansible|
|
config.vm.provision "ansible" do |ansible|
|
||||||
ansible.inventory_path = "vagrant/hosts"
|
ansible.inventory_path = "provision_hosts"
|
||||||
ansible.playbook = "vagrant/vagrant.yml"
|
ansible.playbook = "provision.yml"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
40
domain.yml
40
domain.yml
@ -1,31 +1,25 @@
|
|||||||
---
|
---
|
||||||
# Configurazione dominio
|
# Configurazione dominio
|
||||||
ntpserver: pdc.topolin.ia
|
ntpserver: pdc.mastri.edu
|
||||||
server: pdc
|
server: pdc
|
||||||
serverip: 172.16.254.1
|
serverip: 192.168.1.1
|
||||||
servernetmask: 255.255.255.0
|
servernetmask: 255.255.255.0
|
||||||
servernet: 172.16.254.0
|
servernet: 192.168.1.0
|
||||||
servergw: 172.16.254.1
|
servergw: 192.168.1.1
|
||||||
serverfqdn: pdc.topolin.ia
|
serverfqdn: pdc.mastri.edu
|
||||||
domainshort: TOPOLIN
|
domainshort: MASTRI
|
||||||
domainfull: topolin.ia
|
domainfull: mastri.edu
|
||||||
dhcprange_start: 172.16.254.10
|
dhcprange_start: 192.168.1.10
|
||||||
dhcprange_end: 172.16.254.50
|
dhcprange_end: 192.168.1.50
|
||||||
extdnsserver1: 208.67.222.222
|
extdnsserver1: 208.67.222.222
|
||||||
extdnsserver2: 208.67.220.220
|
extdnsserver2: 208.67.220.220
|
||||||
org_email: info@bglug.it
|
org_email: info@bglug.it
|
||||||
org_company: Accademia di SuperPippo
|
org_company: Istituto Comprensivo 'Mastri Caravaggini'
|
||||||
org_countrycode: IA
|
org_countrycode: IT
|
||||||
org_department: "Laboratorio 1"
|
org_department: "Laboratorio 1"
|
||||||
org_city: Topolinia
|
org_city: Caravaggio
|
||||||
org_phone: "313 113 176-167"
|
org_phone: "+39 0363 50598"
|
||||||
org_street: "Piazza la bomba e scappa"
|
org_street: "Via Zenale e Butinone, 20"
|
||||||
edu_package: secondary
|
mirror_mode: local
|
||||||
mirror_mode: remote
|
#remote_mirror: ubuntu.fastbull.org
|
||||||
#mirror_nfs_share: 192.168.255.1:/var/spool/apt-mirror/mirror
|
client_gitbranch: caravaggio
|
||||||
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"
|
|
||||||
|
2
hosts
2
hosts
@ -2,4 +2,4 @@
|
|||||||
host_key_checking=false
|
host_key_checking=false
|
||||||
|
|
||||||
[server]
|
[server]
|
||||||
172.16.254.1 ansible_ssh_user=amgmt
|
192.168.1.1 ansible_ssh_user=amgmt
|
||||||
|
@ -2,4 +2,4 @@
|
|||||||
# Vagrant provisioning playbook
|
# Vagrant provisioning playbook
|
||||||
- hosts: vagrant
|
- hosts: vagrant
|
||||||
roles:
|
roles:
|
||||||
- rename-nic
|
- rename-nic
|
@ -5,7 +5,7 @@
|
|||||||
comment: "Ansible Management User"
|
comment: "Ansible Management User"
|
||||||
group: wheel
|
group: wheel
|
||||||
state: present
|
state: present
|
||||||
password: $6$mVKMBMbAxeql$eqSe8tu2qKjtwmpiFy07b6nv2g4F80N.U9EzOmQTrNZwKZ61n6NLrSEQHQo1FOlQghOiB8as6Z35oTUUKN8y2.
|
password: $6$rounds=100000$XvHuMoXtpCksx379$nhlfUn38.oBB7JrDrtwfUisw8T0Bg5InzFq1fw31mcEmGZ2AYFkFK2zC2g04lSfw.kpdSgqH3Dl5q9r1fY6.k.
|
||||||
|
|
||||||
- name: Concessione diritti all'utente di gestione Ansible
|
- name: Concessione diritti all'utente di gestione Ansible
|
||||||
template:
|
template:
|
||||||
|
@ -86,12 +86,12 @@
|
|||||||
register: chk_shared
|
register: chk_shared
|
||||||
|
|
||||||
- name: Copying default templates for shared template type
|
- 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
|
when: force_ibay_shared|bool or chk_shared|failed
|
||||||
|
|
||||||
- name: Configuring ibay-shared template structure (directory mask)
|
- name: Configuring ibay-shared template structure (directory mask)
|
||||||
lineinfile:
|
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'
|
line: 'directory mask = 0775'
|
||||||
insertafter: '^create mask'
|
insertafter: '^create mask'
|
||||||
state: present
|
state: present
|
||||||
@ -99,7 +99,7 @@
|
|||||||
|
|
||||||
- name: Configuring force create mode
|
- name: Configuring force create mode
|
||||||
lineinfile:
|
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'
|
line: 'force create mode = 0664'
|
||||||
insertafter: '^directory mask'
|
insertafter: '^directory mask'
|
||||||
state: present
|
state: present
|
||||||
@ -107,7 +107,7 @@
|
|||||||
|
|
||||||
- name: Configuring force directory mode
|
- name: Configuring force directory mode
|
||||||
lineinfile:
|
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'
|
line: 'force directory mode = 0775'
|
||||||
insertafter: '^force create mode'
|
insertafter: '^force create mode'
|
||||||
state: present
|
state: present
|
||||||
|
@ -66,7 +66,7 @@ d-i clock-setup/ntp-server string {{ ansible_local.domain.ntpserver }}
|
|||||||
# User creation
|
# User creation
|
||||||
d-i passwd/user-fullname string BgLUG User
|
d-i passwd/user-fullname string BgLUG User
|
||||||
d-i passwd/username string bglug
|
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
|
# Partitioning
|
||||||
d-i partman-auto/init_automatically_partition select biggest_free
|
d-i partman-auto/init_automatically_partition select biggest_free
|
||||||
|
@ -66,7 +66,7 @@ d-i clock-setup/ntp-server string {{ ansible_local.domain.ntpserver }}
|
|||||||
# User creation
|
# User creation
|
||||||
d-i passwd/user-fullname string BgLUG User
|
d-i passwd/user-fullname string BgLUG User
|
||||||
d-i passwd/username string bglug
|
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
|
# Partitioning
|
||||||
d-i partman-auto/init_automatically_partition select biggest_free
|
d-i partman-auto/init_automatically_partition select biggest_free
|
||||||
|
@ -62,7 +62,7 @@ d-i clock-setup/ntp-server string {{ ansible_local.domain.ntpserver }}
|
|||||||
# User creation
|
# User creation
|
||||||
d-i passwd/user-fullname string BgLUG User
|
d-i passwd/user-fullname string BgLUG User
|
||||||
d-i passwd/username string bglug
|
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
|
# Partitioning
|
||||||
d-i partman-auto/init_automatically_partition select biggest_free
|
d-i partman-auto/init_automatically_partition select biggest_free
|
||||||
|
@ -62,7 +62,7 @@ d-i clock-setup/ntp-server string {{ ansible_local.domain.ntpserver }}
|
|||||||
# User creation
|
# User creation
|
||||||
d-i passwd/user-fullname string BgLUG User
|
d-i passwd/user-fullname string BgLUG User
|
||||||
d-i passwd/username string bglug
|
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
|
# Partitioning
|
||||||
d-i partman-auto/init_automatically_partition select biggest_free
|
d-i partman-auto/init_automatically_partition select biggest_free
|
||||||
|
@ -66,7 +66,7 @@ d-i clock-setup/ntp-server string {{ ansible_local.domain.ntpserver }}
|
|||||||
# User creation
|
# User creation
|
||||||
d-i passwd/user-fullname string BgLUG User
|
d-i passwd/user-fullname string BgLUG User
|
||||||
d-i passwd/username string bglug
|
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
|
# Partitioning
|
||||||
d-i partman-auto/init_automatically_partition select biggest_free
|
d-i partman-auto/init_automatically_partition select biggest_free
|
||||||
|
35
roles/rename-nic/tasks/rename-nic.yml
Normal file
35
roles/rename-nic/tasks/rename-nic.yml
Normal 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
|
@ -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
|
|
Loading…
x
Reference in New Issue
Block a user