Translated all messages within tasks and roles. Revisited the location of some tasks.

This commit is contained in:
Emiliano Vavassori 2015-09-14 01:08:32 +02:00
parent 102aab5328
commit fa2d9d2837
24 changed files with 208 additions and 133 deletions

View File

@ -34,8 +34,3 @@
tags:
- base
- edubuntu
- include: role.yml
tags:
- base
- role

View File

@ -1,11 +0,0 @@
---
# Role based package installation
- name: Installazione pacchetti da aggiungere per il ruolo
apt: name={{ item }} state=present
sudo: yes
with_items: "{{ addpkg }}"
- name: Rimozione pacchetti da rimuovere per il ruolo
apt: name={{ item }} state=absent purge=yes
sudo: yes
with_items: "{{ delpkg }}"

7
roles/client/main.yml Normal file
View File

@ -0,0 +1,7 @@
---
- name: reboot
shell: shutdown -r now "Reboot by Ansible."
sudo: yes
async: 0
poll: 0

View File

@ -0,0 +1,3 @@
---
depenedencies:
- { role: networkpackagemanager, tags: [ 'npm', 'networkpackagemanager' ] }

View File

@ -0,0 +1,43 @@
---
# Managing epoptes on 'client' role
- name: Getting epoptes server name
get_url:
url: "http://{{ serverfqdn }}:3000/epoptes-srv"
dest: /tmp/epoptes-srv
register: get_epo_srv_name
- name: Checking for a correct name
shell: cat /tmp/epoptes-srv
register: epo_srv_name
when: get_epo_srv_name|changed
changed_when: "'none' not in epo_srv_name.stdout"
- name: Configuring the client
lineinfile:
dest: /etc/default/epoptes-client
regexp: "^#SERVER=server"
line: "SERVER={{ epo_srv_name.stdout }}"
state: present
when: epo_srv_name|changed
- name: Checking for an already existent certificate
file:
path: /etc/epoptes/server.crt
status: file
when: epo_srv_name|changed
register: crt_epo_exists
ignore_errors: yes
- name: Getting the epoptes server certificate
shell: /usr/sbin/epoptes-client -c
sudo: yes
when: crt_epo_exists|failed
notify:
- reboot
- name: Cleanup
file:
path: /tmp/epoptes-srv
state: absent
when: get_epo_srv_name|changed

View File

@ -0,0 +1,8 @@
---
# Managing actions for role 'client'
- include: epoptes.yml
when: role == 'client'
tags:
- role
- client

View File

@ -0,0 +1,3 @@
---
depenedencies:
- { role: networkpackagemanager, tags: [ 'npm', 'networkpackagemanager' ] }

View File

@ -0,0 +1,8 @@
---
# Managing Epoptes installation on 'docenti' role.
- name: Configuring the Epoptes server
lineinfile:
dest: /etc/default/epoptes
line: 'SOCKET_GROUP="{{ domainshort }}\docenti"'
state: present

View File

@ -0,0 +1,8 @@
---
# Managing actions for role 'docenti'
- include: epoptes.yml
when: role == 'docenti'
tags:
- role
- docenti

View File

@ -1,16 +1,14 @@
---
- name: Permetto ai domadmins di usare sudo
template: src=sudoers.d dest=/etc/sudoers.d/domain owner=root group=root mode=0440 validate="/usr/sbin/visudo -cf %s"
sudo: yes
# Domain join tasks
- name: verifica join a dominio
- name: Checking domain join
shell: wbinfo -t
sudo: yes
register: check_domain
changed_when: check_domain.rc != 0
ignore_errors: yes
- name: Join a dominio
- name: Joining domain
shell: net rpc join -U admin%{{ domainadminpasswd }}
sudo: yes
when: check_domain|changed

View File

@ -1,51 +0,0 @@
---
- name: "Configuro il pc docente come Epoptes Server"
replace:
regexp: "^#SOCKET_GROUP=epoptes$"
replace: 'SOCKET_GROUP="{{ domainshort }}\docenti"'
dest: /etc/default/epoptes
sudo: yes
when: role == 'docenti'
- name: Trovo il nome dell'epoptes server
get_url:
url: "http://{{ serverfqdn }}:3000/epoptes-srv"
dest: /tmp/epoptes-srv
when: role == 'client'
register: get_epo_srv_name
- name: Verifico il nome, altrimenti salto
shell: cat /tmp/epoptes-srv
register: epo_srv_name
when: role == 'client' and get_epo_srv_name|changed
changed_when: "'none' not in epo_srv_name.stdout"
- name: Configuro il client per Epoptes
replace:
regexp: "^#SERVER=server"
replace: "SERVER={{ epo_srv_name.stdout }}"
dest: /etc/default/epoptes-client
when: role == 'client' and epo_srv_name|changed
sudo: yes
- name: Verifica certificato
file:
path: /etc/epoptes/server.crt
status: file
when: role == 'client' and epo_srv_name|changed
register: crt_epo_exists
ignore_errors: yes
- name: Prendo il certificato
shell: /usr/sbin/epoptes-client -c
sudo: yes
when: role == 'client' and crt_epo_exists|failed
notify:
- reboot
- name: Pulisco
file:
path: /tmp/epoptes-srv
state: absent
sudo: yes
when: get_epo_srv_name|changed

View File

@ -1,20 +1,21 @@
---
# Glib2 settings for a better user experience
- name: Disabilito la visualizzazione utenti in GNOME
- name: Disabling user listings in Metacity menu
copy:
src: com.canonical.indicator.session.gschema.override
dest: /usr/share/glib-2.0/schemas/com.canonical.indicator.session.gschema.override
backup: yes
register: cfg_glib_users
- name: Attivo visibilità dei dischi montati sul desktop
- name: Visualizing mounted drives on desktop
copy:
src: org.gnome.nautilus.desktop.gschema.override
dest: /usr/share/glib-2.0/schemas/org.gnome.nautilus.desktop.gschema.override
backup: yes
register: cfg_glib_mounted
- name: Ricompilo gli schemi glib2
- name: Recompiling glib2 schemas
shell: glib-compile-schemas --strict /usr/share/glib-2.0/schemas/
sudo: yes
when: cfg_glib_users|changed or cfg_glib_mounted|changed

View File

@ -1,5 +1,5 @@
---
# Cambiamenti all'interfaccia grafica
# Adjusting Graphical User Interface
- include: lightdm.yml
tags: lightdm

View File

@ -1,6 +1,7 @@
---
# Adjusting lightdm settings
- name: Altre impostazioni lightdm
- name: Adjusting lightdm settings
lineinfile:
dest: /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf
regexp: "{{ item }}"

View File

@ -1,6 +1,5 @@
---
# Configurazioni per messa in dominio.
# Impostazioni grafiche da gestire in dominio
# Domain configurations
- include: ntp.yml
tags:
@ -27,11 +26,6 @@
- domain
- pkgs
- include: epoptes.yml
tags:
- domain
- epoptes
- include: pam_base.yml
tags:
- domain

View File

@ -1,3 +1,11 @@
---
- name: Configurazione nsswitch.conf
template: src=nsswitch.conf dest=/etc/nsswitch.conf backup=yes owner=root group=root mode=0644
# configuring NSS
- name: Configuring NSS
template:
src: nsswitch.conf
dest: /etc/nsswitch.conf
backup: yes
owner: root
group: root
mode: 0644

View File

@ -1,23 +1,31 @@
---
- name: Installazione ntp
apt: name=ntp state=present
sudo: yes
# Configuring NTP for domain clients
- name: Configurazione ntp
template: src=ntp.conf dest=/etc/ntp.conf backup=yes owner=root group=root mode=0644
sudo: yes
- name: Installing NTP
apt:
name: ntp
state: present
- name: Configuring NTP
template:
src: ntp.conf
dest: /etc/ntp.conf
backup: yes
owner: root
group: root
mode: 0644
register: cfg_ntp
- name: Permetto a NTP di utilizzare informazioni da winbind
- name: Configuring AppArmor for NTP
lineinfile:
dest: /etc/apparmor.d/usr.sbin.ntpd
regexp: "/run/samba/winbindd/pipe"
line: ' /run/samba/winbindd/pipe crw,'
insertafter: 'samba/ntp_signd/socket'
state: present
sudo: yes
- name: Riavvio ntp
service: name=ntp state=restarted
sudo: yes
- name: Restarting NTP service
service:
name: ntp
state: restarted
when: cfg_ntp|changed

View File

@ -1,9 +1,13 @@
---
# Configurazione di base di PAM per dominio
# base configuration for PAM Module
- name: Installazione libpam-winbind
apt: name=libpam-winbind state=present
sudo: yes
- name: Installing winbind bindings for PAM
apt:
name: libpam-winbind
state: present
# Leaving them here commented, as they may be needed in the future
# for improvements on login times.
# common-auth

View File

@ -1,10 +1,13 @@
---
# Configurazione base per pam_mount
# PAM_mount configuration
- name: Installazione pam_mount
apt: name=libpam-mount state=present
sudo: yes
- name: Installing pam_mount
apt:
name: libpam-mount
state: present
- name: Configurazione di pam_mount
template: src=pam_mount.conf.xml dest=/etc/security/pam_mount.conf.xml backup=yes
sudo: yes
- name: Configuring pam_mount
template:
src: pam_mount.conf.xml
dest: /etc/security/pam_mount.conf.xml
backup: yes

View File

@ -1,7 +1,10 @@
---
- name: Installazione pacchetti necessari per dominio
apt: pkg={{ item }} state=present
sudo: yes
# Packages needed for domain join
- name: Installing domain packages
apt:
pkg: {{ item }}
state: present
with_items:
- winbind
- samba

View File

@ -1,26 +1,44 @@
---
- name: Configurazione smb.conf
template: src=smb.conf dest=/etc/samba/smb.conf validate='testparm -s %s' backup=yes
sudo: yes
# SAMBA configuration for domain
- name: Configuring SAMBA
template:
src: smb.conf
dest: /etc/samba/smb.conf
validate: 'testparm -s %s'
backup: yes
register: cfg_samba
- name: Configuro la home per apparmor
- name: Configuring AppArmor home directories
replace:
dest: /etc/apparmor.d/tunables/home
regexp: '^@\{HOMEDIRS\}=/home/$'
replace: '@{HOMEDIRS}=/home/ /home/{{ domainshort }}/'
sudo: yes
- name: Riavvio samba
shell: restart smbd
sudo: yes
- name: SAMBA restart
service:
name: smbd
state: restarted
when: cfg_samba|changed
- name: Riavvio winbind
shell: restart winbind
sudo: yes
- name: Winbind restart
service:
name: winbind
state: restarted
when: cfg_samba|changed
- name: Creazione home base
file: path=/home/{{ domainshort }} owner=root group=root state=directory
sudo: yes
- name: Creating home base
file:
path: '/home/{{ domainshort }}'
owner: root
group: root
state: directory
- name: Permitting SAMBA domopers to run sudo
template:
src: sudoers.d
dest: /etc/sudoers.d/domain
owner: root
group: root
mode: 0440
validate: "/usr/sbin/visudo -cf %s"

View File

@ -1,5 +1,7 @@
---
- name: Verifico presenza di directory necessarie
# Adjusting system for domain proxy certificate
- name: Creating needed directories
file:
path: '{{ item }}'
mode: 0755
@ -7,22 +9,19 @@
with_items:
- /usr/lib/firefox/browser/defaults/profile
- /usr/local/share/ca-certificates/{{ domainfull }}
sudo: yes
- name: Scarico il certificato client per proxy trasparente SSL
- name: Getting SSL transparent proxy certificate
get_url:
url: http://{{ serverfqdn }}/proxy.crt
url: 'http://{{ serverfqdn }}/proxy.crt'
dest: /usr/local/share/ca-certificates/{{ domainfull }}/ca.crt
sudo: yes
register: proxycrt_dwnl
- name: Aggiungo il certificato a quelli utilizzati dal sistema
- name: Adding certificate sto the ones used by the system
shell: update-ca-certificates
when: proxycrt_dwnl|changed
sudo: yes
- name: Scarico il database dei certificati di FF con certificato server aggiornato.
- name: Firefox settings to include certificate
get_url:
url: 'http://{{ serverfqdn }}/ks/cert8.db'
dest: /usr/lib/firefox/browser/defaults/profile
sudo: yes

View File

@ -0,0 +1,13 @@
---
# Managing installation/deletion of packages set with NetworkPackageManager
# within NethServer console
- name: Installing packages for specific role from NetworkPackageManager
apt: name={{ item }} state=present
sudo: yes
with_items: "{{ addpkg }}"
- name: Removing packages for specific role from NetworkPackageManager
apt: name={{ item }} state=absent purge=yes
sudo: yes
with_items: "{{ delpkg }}"

12
vagrantbox.yml Normal file
View File

@ -0,0 +1,12 @@
---
- hosts: localhost
user: root
vars_files:
- domainpwd.vault
vars:
vagrantbox: true
roles:
- vagrantbox