Aggiunta ruolo non idempotente per configurazione server.
This commit is contained in:
parent
e34abe39ea
commit
d6db622697
20
domain.yml
Normal file
20
domain.yml
Normal file
@ -0,0 +1,20 @@
|
||||
---
|
||||
# Configurazione dominio LAB1
|
||||
servershort: pdc
|
||||
serverfqdn: pdc.lab1.local
|
||||
domainlong: lab1.local
|
||||
domainshort: LAB1
|
||||
serverip: 192.168.0.1
|
||||
servernetmask: 255.255.255.0
|
||||
servernet: 192.168.0.0
|
||||
servergw: 192.168.0.1
|
||||
dhcprange_start: 192.168.0.10
|
||||
dhcprange_end: 192.168.0.50
|
||||
extdnsserver1: 208.67.222.222
|
||||
extdnsserver2: 208.67.220.220
|
||||
org_company: Istituto Comprensivo Mastri Caravaggini
|
||||
org_countrycode: IT
|
||||
org_department: "Laboratorio 1"
|
||||
org_city: Caravaggio
|
||||
org_phone: "+39 0363 50598"
|
||||
org_street: "Via Zenale e Butinone, 20"
|
2
hosts
2
hosts
@ -2,4 +2,4 @@
|
||||
host_key_checking=false
|
||||
|
||||
[server]
|
||||
10.0.0.1 ansible_ssh_user=amgmt
|
||||
localhost ansible_ssh_port=2222 ansible_ssh_user=amgmt
|
||||
|
6
nethcfg.yml
Normal file
6
nethcfg.yml
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
- hosts: server
|
||||
vars_files:
|
||||
- domain.yml
|
||||
roles:
|
||||
- nethcfg
|
116
roles/nethcfg/tasks/main.yml
Normal file
116
roles/nethcfg/tasks/main.yml
Normal file
@ -0,0 +1,116 @@
|
||||
---
|
||||
# Configurazione principale di NethServer.
|
||||
|
||||
- name: Configurazione organizzazione
|
||||
shell: /sbin/e-smith/db configuration setprop OrganizationContact City "{{ org_city }}" Company "{{ org_company }}" CountryCode {{ org_countrycode }} Department "{{ org_department }}" PhoneNumber "{{ org_phone }}" Street "{{ org_street }}"
|
||||
sudo: yes
|
||||
|
||||
- name: Configurazione scheda di rete esterna
|
||||
shell: /sbin/e-smith/db configuration setprop eth0 role red bootproto dhcp
|
||||
sudo: yes
|
||||
|
||||
- name: Configurazione scheda di rete interna
|
||||
shell: /sbin/e-smith/db configuration setprop eth1 role green ipaddr {{ serverip }} netmask {{ servernetmask }}
|
||||
sudo: yes
|
||||
|
||||
- name: Configurazione rete trusted
|
||||
shell: /sbin/e-smith/db networks set {{ servernet }} network Description "Local LAN" Mask {{ servernetmask }}
|
||||
sudo: yes
|
||||
|
||||
- name: Configurazione nome server
|
||||
shell: /sbin/e-smith/db configuration set SystemName {{ servershort }}
|
||||
sudo: yes
|
||||
|
||||
- name: Configurazione nome dominio
|
||||
shell: /sbin/e-smith/db configuration set DomainName {{ domainlong }}
|
||||
sudo: yes
|
||||
|
||||
- name: Attivo configurazioni di rete
|
||||
shell: /sbin/e-smith/signal-event interface-update
|
||||
sudo: yes
|
||||
|
||||
- name: Configurazione forza password
|
||||
shell: /sbin/e-smith/db configuration setprop passwordstrength PassExpires no Users none
|
||||
sudo: yes
|
||||
|
||||
- name: Attivo configurazione policy password
|
||||
shell: /sbin/e-smith/signal-event password-policy-update
|
||||
sudo: yes
|
||||
|
||||
- name: Configurazione servizio DHCP
|
||||
shell: /sbin/e-smith/db dhcp setprop eth1 DhcpRangeStart {{ dhcprange_start }} DhcpRangeEnd {{ dhcprange_end }} status enabled
|
||||
sudo: yes
|
||||
|
||||
- name: Attivazione configurazione DHCP
|
||||
shell: /sbin/e-smith/signal-event network-modify
|
||||
sudo: yes
|
||||
|
||||
- name: Configurazione servizio DNS
|
||||
shell: /sbin/e-smith/db configuration setprop dns role resolver NameServers "{{ extdnsserver1 }},{{ extdnsserver2 }}"
|
||||
sudo: yes
|
||||
register: cfg_dns
|
||||
|
||||
- name: Attivo configurazione DNS
|
||||
shell: /sbin/e-smith/signal-event nethserver-dnsmasq-save
|
||||
when: cfg_dns|changed
|
||||
sudo: yes
|
||||
|
||||
- name: Configuro NTP
|
||||
shell: /sbin/e-smith/db configuration setprop ntpd NTPServer ntp1.inrim.it status enabled
|
||||
sudo: yes
|
||||
|
||||
- name: Attivazione NTP
|
||||
shell: /sbin/e-smith/signal-event nethserver-ntp-update
|
||||
sudo: yes
|
||||
|
||||
- name: Configurazione SMB
|
||||
shell: /sbin/e-smith/db configuration setprop smb RoamingProfiles yes ServerRole PDC Workgroup {{ domainshort }} status enabled
|
||||
sudo: yes
|
||||
|
||||
- name: Attivo configurazione SMB
|
||||
shell: /sbin/e-smith/signal-event nethserver-samba-update
|
||||
sudo: yes
|
||||
|
||||
- name: Creazione gruppo Domain Users
|
||||
shell: /sbin/e-smith/db accounts set domusers group Gid 502 Description "Domain Users" Members admin Removable no
|
||||
sudo: yes
|
||||
|
||||
- name: Configurazione nuovo gruppo Domain Users
|
||||
shell: /sbin/e-smith/signal-event group-create
|
||||
sudo: yes
|
||||
|
||||
- name: Configurazione share Condiviso
|
||||
shell: /sbin/e-smith/db accounts set shared ibay AclRead domadmins,domusers AclWrite domadmins,domusers Description "Cartella condivisa" GroupAccess rw HttpStatus disabled OtherAccess r OwningGroup locals SmbAuditStatus enabled SmbGuestAccessType none SmbRecycleBinStatus enabled SmbRecycleBinVersionsStatus disabled SmbStatus enabled
|
||||
sudo: yes
|
||||
|
||||
- name: Attivazione share condiviso
|
||||
shell: /sbin/e-smith/signal-event nethserver-ibays-update
|
||||
sudo: yes
|
||||
|
||||
- name: Configurazione squid
|
||||
shell: /sbin/e-smith/db configuration setprop squid BlueMode transparent GreenMode transparent PortBlock enabled status enabled DiskCache enabled DiskCacheSize 500
|
||||
sudo: yes
|
||||
|
||||
- name: Attivazione configurazione squid
|
||||
shell: /sbin/e-smith/signal-event nethserver-squid-update
|
||||
sudo: yes
|
||||
|
||||
- name: Configurazione squidguard
|
||||
shell: /sbin/e-smith/db configuration setprop squidguard Expressions enabled Lists shalla status enabled
|
||||
sudo: yes
|
||||
|
||||
- name: Scarico liste di filtraggio
|
||||
shell: /sbin/e-smith/signal-event nethserver-squidguard-downloadlists
|
||||
sudo: yes
|
||||
|
||||
- name: Attivazione squidguard
|
||||
shell: /sbin/e-smith/signal-event nethserver-squidguard-update
|
||||
sudo: yes
|
||||
|
||||
- name: Configurazione squidclamav
|
||||
shell: /sbin/e-smith/db configuration setprop squidclamav status enabled
|
||||
sudo: yes
|
||||
|
||||
- name: Attivazione squidclamav
|
||||
shell: /sbin/e-smith/signal-event nethserver-squidclamav-update
|
||||
sudo: yes
|
@ -16,7 +16,3 @@
|
||||
- include: neth_pkgs.yml
|
||||
when: ansible_distribution == "CentOS" and ansible_os_family == "RedHat"
|
||||
tags: neth
|
||||
|
||||
- include: neth_config.yml
|
||||
when: ansible_distribution == "CentOS" and ansible_os_family == "RedHat"
|
||||
tags: neth
|
||||
|
Loading…
x
Reference in New Issue
Block a user