2015-06-23 19:38:22 +00:00
---
2015-08-20 21:02:53 +00:00
- name : Verifica configurazione organizzazione
shell : /sbin/e-smith/db configuration printprop OrganizationContact City
register : check_org
changed_when : "'City={{ ansible_local.domain.org_city }}' not in check_org.stdout"
ignore_errors : yes
sudo : yes
2015-06-23 19:38:22 +00:00
- name : Configurazione organizzazione
2015-07-21 22:24:00 +00:00
shell : /sbin/e-smith/db configuration setprop OrganizationContact City "{{ ansible_local.domain.org_city }}" Company "{{ ansible_local.domain.org_company }}" CountryCode {{ ansible_local.domain.org_countrycode }} Department "{{ ansible_local.domain.org_department }}" PhoneNumber "{{ ansible_local.domain.org_phone }}" Street "{{ ansible_local.domain.org_street }}"
2015-06-23 19:38:22 +00:00
sudo : yes
2015-08-20 21:02:53 +00:00
when : check_org|changed
2015-06-23 19:38:22 +00:00
- name : Configurazione nome server
2015-07-21 22:24:00 +00:00
shell : /sbin/e-smith/db configuration set SystemName {{ ansible_local.domain.server }}
2015-06-23 19:38:22 +00:00
sudo : yes
2015-08-20 21:02:53 +00:00
register : chg_hostname
when : "'{{ ansible_hostname }}' != '{{ ansible_local.domain.server }}'"
2015-06-23 19:38:22 +00:00
- name : Configurazione nome dominio
2015-07-21 22:24:00 +00:00
shell : /sbin/e-smith/db configuration set DomainName {{ ansible_local.domain.domainfull }}
2015-06-23 19:38:22 +00:00
sudo : yes
2015-08-20 21:02:53 +00:00
register : chg_domainname
when : "'{{ ansible_domain }}' != '{{ ansible_local.domain.domainfull }}'"
2015-06-23 19:38:22 +00:00
- name : Attivazione cambiamenti hostname
shell : /sbin/e-smith/signal-event hostname-modify
sudo : yes
2015-08-20 21:02:53 +00:00
when : chg_hostname|changed or chg_domainname|changed
- name : Verifica robustezza password
shell : /sbin/e-smith/db configuration printprop passwordstrength Users
register : chk_passstr
changed_when : "'Users=none' not in chk_passstr.stdout"
sudo : yes
ignore_errors : true
2015-06-23 19:38:22 +00:00
- name : Configurazione forza password
2015-09-06 18:35:27 +00:00
shell : /sbin/e-smith/db configuration setprop passwordstrength PassExpires no Users none Admin strong MaxPassAge 180 MinPassAge 0 PassExpires no PassWarning 7
2015-06-23 19:38:22 +00:00
sudo : yes
2015-08-20 21:02:53 +00:00
when : chk_passstr|changed
2015-06-23 19:38:22 +00:00
- name : Attivo configurazione policy password
shell : /sbin/e-smith/signal-event password-policy-update
sudo : yes
2015-08-20 21:02:53 +00:00
when : chk_passstr|changed
- name : Verifica configurazione DHCP
shell : /sbin/e-smith/db dhcp getprop eth1 DhcpRangeStart
sudo : yes
ignore_errors : true
register : chk_dhcp
2015-06-23 19:38:22 +00:00
- name : Configurazione servizio DHCP
2015-07-21 22:24:00 +00:00
shell : /sbin/e-smith/db dhcp set eth1 range DhcpRangeStart {{ ansible_local.domain.dhcprange_start }} DhcpRangeEnd {{ ansible_local.domain.dhcprange_end }} status enabled
2015-06-23 19:38:22 +00:00
sudo : yes
2015-08-20 21:02:53 +00:00
when : chk_dhcp|failed
2015-06-23 19:38:22 +00:00
- name : Attivazione configurazione DHCP
2015-07-22 05:58:18 +00:00
shell : /sbin/e-smith/signal-event nethserver-dnsmasq-save
2015-06-23 19:38:22 +00:00
sudo : yes
2015-08-20 21:02:53 +00:00
when : chk_dhcp|failed
- name : Verifica configurazione DNS
shell : /sbin/e-smith/db configuration printprop dns NameServers
sudo : yes
register : chk_dns
changed_when : "'NameServers={{ ansible_local.domain.extdnsserver1 }},{{ ansible_local.domain.extdnsserver2 }}' not in chk_dns.stdout"
ignore_errors : yes
2015-06-23 19:38:22 +00:00
- name : Configurazione servizio DNS
2015-07-21 22:24:00 +00:00
shell : /sbin/e-smith/db configuration setprop dns role resolver NameServers "{{ ansible_local.domain.extdnsserver1 }},{{ ansible_local.domain.extdnsserver2 }}"
2015-06-23 19:38:22 +00:00
sudo : yes
2015-08-20 21:02:53 +00:00
when : chk_dns|changed
2015-06-23 19:38:22 +00:00
- name : Attivo configurazione DNS
shell : /sbin/e-smith/signal-event nethserver-dnsmasq-save
2015-08-20 21:02:53 +00:00
when : chk_dns|changed
2015-06-23 19:38:22 +00:00
sudo : yes
2015-08-20 21:02:53 +00:00
- name : Verifica configurazione NTP
shell : /sbin/e-smith/db configuration printprop ntpd NTPServer
sudo : yes
register : chk_ntp
changed_when : "'NTPServer=ntp1.inrim.it' not in chk_ntp.stdout"
ignore_errors : true
2015-06-23 19:38:22 +00:00
- name : Configuro NTP
shell : /sbin/e-smith/db configuration setprop ntpd NTPServer ntp1.inrim.it status enabled
sudo : yes
2015-08-20 21:02:53 +00:00
when : chk_ntp|changed
2015-06-23 19:38:22 +00:00
- name : Attivazione NTP
shell : /sbin/e-smith/signal-event nethserver-ntp-update
sudo : yes
2015-08-20 21:02:53 +00:00
when : chk_ntp|changed
2015-06-23 19:38:22 +00:00
2015-08-20 04:20:41 +00:00
- name : Utilizzo unix extensions nei template per ibay
replace :
dest : /etc/e-smith/templates/etc/samba/smb.conf/10global
regexp : '^unix extensions = no$'
replace : 'unix extensions = yes'
sudo : yes
2015-08-20 21:02:53 +00:00
- name : Verifica configurazione SMB
shell : /sbin/e-smith/db configuration printprop smb RoamingProfiles
sudo : yes
register : chk_smb
changed_when : "'RoamingProfiles=yes' not in chk_smb.stdout"
ignore_errors : true
2015-06-23 19:38:22 +00:00
- name : Configurazione SMB
2015-07-21 22:24:00 +00:00
shell : /sbin/e-smith/db configuration setprop smb RoamingProfiles yes ServerRole PDC Workgroup "{{ ansible_local.domain.domainshort }}" status enabled
2015-06-23 19:38:22 +00:00
sudo : yes
2015-08-20 21:02:53 +00:00
when : chk_smb|changed
2015-06-23 19:38:22 +00:00
- name : Attivo configurazione SMB
shell : /sbin/e-smith/signal-event nethserver-samba-save
sudo : yes
2015-08-20 21:02:53 +00:00
when : chk_smb|changed
- name : Verifico la presenza del gruppo Domain Users
shell : /sbin/e-smith/db accounts show domusers
register : check_domusers
sudo : yes
ignore_errors : true
2015-06-23 19:38:22 +00:00
- name : Creazione gruppo Domain Users
shell : /sbin/e-smith/db accounts set domusers group Description "Domain Users" Members admin Removable no
sudo : yes
2015-08-20 21:02:53 +00:00
when : check_domusers|failed
2015-06-23 19:38:22 +00:00
- name : Configurazione nuovo gruppo Domain Users
shell : /sbin/e-smith/signal-event group-create domusers
sudo : yes
2015-08-20 21:02:53 +00:00
when : check_domusers|failed
- name : Verifico la presenza del gruppo Domain Operators
shell : /sbin/e-smith/db accounts show domopers
register : check_domopers
sudo : yes
ignore_errors : true
2015-06-23 19:38:22 +00:00
2015-07-28 20:35:17 +00:00
- name : Creazione gruppo Domain Operators
shell : /sbin/e-smith/db accounts set domopers group Description "Domain Operators" Removable no
sudo : yes
2015-08-20 21:02:53 +00:00
when : check_domopers|failed
2015-07-28 20:35:17 +00:00
- name : Configurazione nuovo gruppo Domain Operators
shell : /sbin/e-smith/signal-event group-create domopers
sudo : yes
2015-08-20 21:02:53 +00:00
when : check_domopers|failed
2015-07-28 20:35:17 +00:00
2015-06-24 20:17:08 +00:00
- name : Abilito il ricaricamento dei servizi smb su ibay-create
2015-06-25 21:51:52 +00:00
file : src="reload" dest="{{ item }}/smb" state=link force=yes
2015-06-24 20:17:08 +00:00
with_items :
- /etc/e-smith/events/ibay-delete/services2adjust
- /etc/e-smith/events/ibay-create/services2adjust
- /etc/e-smith/events/ibay-modify/services2adjust
sudo : yes
2015-08-20 21:02:53 +00:00
- name : Verifica creazione share condiviso
shell : /sbin/e-smith/db accounts show shared
sudo : yes
ignore_errors : true
register : chk_shared
2015-06-23 19:38:22 +00:00
- name : Configurazione share Condiviso
shell : /sbin/e-smith/db accounts set shared ibay AclRead domusers,domadmins AclWrite domusers,domadmins Description "Cartella condivisa" GroupAccess rw HttpStatus disabled OtherAccess r OwningGroup locals SmbAuditStatus enabled SmbGuestAccessType none SmbRecycleBinStatus enabled SmbRecycleBinVersionsStatus enabled SmbStatus enabled
sudo : yes
2015-08-20 21:02:53 +00:00
when : chk_shared|failed
2015-06-23 19:38:22 +00:00
- name : Attivazione share condiviso
2015-06-24 20:17:08 +00:00
shell : /sbin/e-smith/signal-event ibay-create shared
2015-06-23 19:38:22 +00:00
sudo : yes
2015-08-20 21:02:53 +00:00
when : chk_shared|failed
- name : Verifica configurazione squid
shell : /sbin/e-smith/db configuration printprop squid GreenMode
sudo : yes
ignore_errors : yes
register : chk_squid
changed_when : "'GreenMode=transparent_ssl' not in chk_squid.stdout"
2015-06-23 19:38:22 +00:00
- name : Configurazione squid
2015-08-19 01:10:08 +00:00
shell : /sbin/e-smith/db configuration setprop squid BlueMode transparent_ssl GreenMode transparent_ssl PortBlock enabled status enabled DiskCache enabled DiskCacheSize 500
2015-06-23 19:38:22 +00:00
sudo : yes
2015-08-20 21:02:53 +00:00
when : chk_squid|changed
2015-06-23 19:38:22 +00:00
- name : Attivazione configurazione squid
shell : /sbin/e-smith/signal-event nethserver-squid-update
sudo : yes
2015-08-20 21:02:53 +00:00
when : chk_squid|changed
- name : Verifica configurazione squidguard
shell : /sbin/e-smith/db configuration printprop squidguard Lists
sudo : yes
ignore_errors : true
register : chk_squidguard
changed_when : "'Lists=shalla' not in chk_squidguard.stdout"
2015-06-23 19:38:22 +00:00
- name : Configurazione squidguard
shell : /sbin/e-smith/db configuration setprop squidguard Expressions enabled Lists shalla status enabled
sudo : yes
2015-08-20 21:02:53 +00:00
when : chk_squidguard|changed
2015-06-23 19:38:22 +00:00
- name : Scarico liste di filtraggio
shell : /sbin/e-smith/signal-event nethserver-squidguard-downloadlists
sudo : yes
2015-08-20 21:02:53 +00:00
when : chk_squidguard|changed
2015-06-23 19:38:22 +00:00
- name : Attivazione squidguard
shell : /sbin/e-smith/signal-event nethserver-squidguard-update
sudo : yes
2015-08-20 21:02:53 +00:00
when : chk_squidguard|changed
- name : Verifica configurazione squidclamav
shell : /sbin/e-smith/db configuration printprop squidclamav status
sudo : yes
ignore_errors : true
register : chk_squidclamav
changed_when : "'status=enabled' not in chk_squidclamav.stdout"
2015-06-23 19:38:22 +00:00
- name : Configurazione squidclamav
shell : /sbin/e-smith/db configuration setprop squidclamav status enabled
sudo : yes
2015-08-20 21:02:53 +00:00
when : chk_squidclamav|changed
2015-06-23 19:38:22 +00:00
- name : Attivazione squidclamav
shell : /sbin/e-smith/signal-event nethserver-squidclamav-update
sudo : yes
2015-08-20 21:02:53 +00:00
when : chk_squidclamav|changed
- name : Verifica completamento configurazione per certificato
shell : /sbin/e-smith/db configuration printprop pki CommonName
sudo : yes
ignore_errors : true
register : chk_crt
changed_when : "'CommonName={{ ansible_local.domain.serverfqdn }}' not in chk_crt.stdout"
- name : Completo la configurazione per produzione certificato
shell : /sbin/e-smith/db configuration setprop pki CertificateDuration 3650 CommonName {{ ansible_local.domain.serverfqdn }}
sudo : yes
when : chk_crt|changed
- name : Rigenero il certificato con le informazioni inserite
shell : /sbin/e-smith/signal-event certificate-update
sudo : yes
tags : regen-ca