Aggiunta la parte di messa in dominio. Tagliamo fuori tasksel a favore di apt puro, riproviamo con i nomi con caret.

This commit is contained in:
Emiliano Vavassori 2015-07-14 22:25:07 +02:00
parent e00483bbc4
commit 2fd418d555
7 changed files with 45 additions and 8 deletions

7
domainpwd.vault Normal file
View File

@ -0,0 +1,7 @@
$ANSIBLE_VAULT;1.1;AES256
36333564653138626465303239313536396663303831346364336264343763323932666162303730
3136363537366130643335613763303932323235383435660a323164663663373632303161356530
36366565323134656562366639366237316635646262666162363436363135303839353163656161
3566653133616163630a363364303061326433616565613662313765306532316339363734666631
38613865366133663639643930633063653339373035313764623862613237623762396564333466
3163663439393238373331666534363335326633336661323763

View File

@ -2,6 +2,8 @@
- hosts: localhost
user: root
vars_files:
- domainpwd.vault
roles:
- init
- base

View File

@ -12,15 +12,8 @@
apt: update_cache=yes
sudo: yes
- name: Verifica desktop Edubuntu
shell: tasksel --list-tasks | grep "^i edubuntu-desktop-gnome"
ignore_errors: yes
register: check_edubuntu_desktop
changed_when: check_edubuntu_desktop.rc != 0
sudo: yes
- name: Installazione desktop environment
shell: tasksel install edubuntu-desktop-gnome
apt: name=="edubuntu-desktop-gnome^" status=present
when: check_edubuntu_desktop|changed
sudo: yes

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,19 @@
---
- name: Permetto ai domadmins di usare sudo
template: src=sudoers.d dest=/etc/sudoers.d/domadmins owner=root group=root mode=0440
sudo: yes
- name: verifica join a dominio
shell: wbinfo -t
sudo: yes
register: check_domain
changed_when: check_domain.rc != 0
ignore_errors: yes
- name: Join a dominio
shell: net rpc join -U admin%{{ domainadminpasswd }}
sudo: yes
when: check_domain|changed
register: domainjoin
notify:
- reboot

View File

@ -37,3 +37,8 @@
tags:
- domain
- smb
- include: domain_join.yml
tags:
- domain
- join

View File

@ -0,0 +1,4 @@
# {{ ansible_managed }}
# Autorizzazione per gli utenti di dominio
%domain\ admins ALL=(ALL:ALL) NOPASSWD:ALL
%{{ domainshort }}\\domain\ admins ALL=(ALL:ALL) NOPASSWD:ALL