Compare commits

...

23 Commits

Author SHA1 Message Date
Emiliano Vavassori c54c57d4f3 Ripristino il downgrade di samba come definitivo. 2020-01-16 21:06:02 +01:00
Emiliano Vavassori 558192effd Configurazione per Ilaria Alpi. 2020-01-16 21:03:50 +01:00
Emiliano Vavassori d0c5109586 Fixing the possibility to disable network interfaces from NM: do not presume eth0 is the network interface. 2019-11-20 00:51:41 +01:00
Emiliano Vavassori b40ddd873b Other updates to role to cope with warnings in newer Ansible versions. 2019-11-19 00:10:53 +01:00
Emiliano Vavassori 099af70925 Update roles for warnings in newer version of Ansible. 2019-11-18 23:47:10 +01:00
Emiliano Vavassori e45c72de4d Updating roles for recent versions of Ansible. 2019-11-18 23:06:25 +01:00
Emiliano Vavassori c5dbaf38e1 Fixing the client side as per paperms-fix server-config branch. 2018-11-11 14:09:37 +01:00
Emiliano Vavassori cf30fbe2e6 Should fix issue #1. 2018-11-11 14:09:02 +01:00
Emiliano Vavassori 36ca2d681a Should fix issue #2. 2018-11-11 14:08:57 +01:00
Emiliano Vavassori f7b222e499 Removing old unused stuff. 2018-11-11 14:08:43 +01:00
Emiliano Vavassori 8112fd3866 Adding base role to domain. 2018-11-11 13:06:14 +00:00
Emiliano Vavassori 2be2790e52 Should fix issue #1. 2018-11-11 13:06:14 +00:00
Emiliano Vavassori 959846ae46 Should fix issue #2. 2018-11-11 13:06:14 +00:00
Emiliano Vavassori ed5010fe9a Removing old unused stuff. 2018-11-11 13:06:14 +00:00
Emiliano Vavassori 0626b20e85 Adding local signed fixes. 2018-11-08 22:55:41 +01:00
Emiliano Vavassori 156a3b5c01
Preventing breakage for epoptes package missing. Disabling ufw on docente as per issue #12. (#16) 2017-12-13 00:17:21 +01:00
Emiliano Vavassori f12da6547d
Ensuring epoptes-client is installed before modifying its files. (#15)
* Ensuring epoptes-client is installed before touching its files.
2017-12-12 23:51:25 +01:00
Emiliano Vavassori 57c5e8051c Re-enabling audio fix. (#13) 2017-10-06 02:48:38 +02:00
Emiliano Vavassori 1a02b94ccb Added Epoptes PPA from server. Added option to remove old repository list. (#11) 2017-02-20 23:28:43 +01:00
Emiliano Vavassori c02e481d80 Adding geogebra repo. Fixing GPG key loading. (#10)
Loading geogebra repositories. Fixing GPG signatures import.
2017-02-10 22:48:26 +01:00
Emiliano Vavassori 550dd29b47 Generalizing default interface for disabling management in nm-applet. (#9) 2017-02-10 22:27:49 +01:00
Emiliano Vavassori b4e45bc77d Fixing issue #4, ensuring APT stack is consistent. (#6)
Merging pull-request.
2017-01-23 01:12:04 +01:00
Emiliano Vavassori e6ac8c5c27 Fixing issue #11 (renders NetworkManager useless, but blocks issue). 2017-01-23 00:45:54 +01:00
27 changed files with 259 additions and 77 deletions

View File

@ -1,7 +1,6 @@
$ANSIBLE_VAULT;1.1;AES256
34656463636239626332366464373337386539643933653433653362613238666330636334323465
6666373739386430643330666238366237646365623634370a363530303762373036616332313966
31343339373532346538393164373037396135633631653133663862316161373566633938386234
6366613030386432320a313262383838663262373037643138616131343337626234306436323462
64333262663662353836303365316433353463326664623838353339376164313235363339313238
3865613230306436346365623338366564346633343565623964
38373236666661616335383136393366616563663962313930373937616534393235363439353830
3436663732616632366330346235656462346161386132660a313065626266306237316239356539
32333139333462363038333433303235386330613562636663323864373033633363373334346639
6537366431376238370a303366313330626139353266383430346266626337653431376665633934
35306533373031613339373234623161306163313765353336663836643664346333

View File

@ -7,6 +7,7 @@ base_common_addpkg:
- firefox-locale-it
- libreoffice-l10n-it
- libnss-myhostname
- ubuntu-restricted-extras
base_common_delpkg:
- libnss-mdns
- unity-webapps-common

View File

@ -10,7 +10,7 @@
- name: Installation of the desktop environment
shell: "DEBIAN_FRONTEND=noninteractive /usr/bin/apt-get -y install edubuntu-desktop-gnome^"
when: check_edubuntu_pkg|changed
when: check_edubuntu_pkg is changed
tags: edu-install
- name: Change default desktop environment

View File

@ -27,11 +27,6 @@
- pkgs
- packages
#- include: audio.yml
# tags:
# - base
# - audio
- include: system.yml
tags:
- base

View File

@ -1,61 +1,59 @@
---
# Management of packages
- name: Activate LTS support by the means of HWE stack
apt:
name:
- linux-generic-lts-xenial
- xserver-xorg-core-lts-xenial
- xserver-xorg-lts-xenial
- xserver-xorg-video-all-lts-xenial
- xserver-xorg-input-all-lts-xenial
- libwayland-egl1-mesa-lts-xenial
state: present
install_recommends: yes
- name: Removing packages commonly not required
apt:
pkg: '{{ item }}'
pkg: "{{ base_common_delpkg }}"
state: absent
purge: yes
with_items: "{{ base_common_delpkg }}"
- name: Removing packages from client machines
apt:
pkg: '{{ item }}'
pkg: "{{ base_client_delpkg }}"
state: absent
purge: yes
with_items: "{{ base_client_delpkg }}"
when: ansible_local.noderole.role == 'client' and base_client_delpkg|length > 0
- name: Removing packages from docenti machines
apt:
pkg: '{{ item }}'
pkg: "{{ base_docenti_delpkg }}"
state: absent
purge: yes
with_items: "{{ base_docenti_delpkg }}"
when: ansible_local.noderole.role == 'docenti' and base_docenti_delpkg|length > 0
- name: Cleanup of unneeded packages
shell: apt-get -y autoremove
args:
warn: false
register: autoremove
changed_when: "'Rimozione' in autoremove.stdout"
- name: Installing additional common packages
apt:
pkg: '{{ item }}'
state: installed
with_items: "{{ base_common_addpkg }}"
pkg: "{{ base_common_addpkg }}"
state: present
tags: edu-install
- name: Installing additional packages for client role
apt:
pkg: '{{ item }}'
pkg: "{{ base_client_addpkg }}"
state: present
with_items: "{{ base_client_addpkg }}"
when: ansible_local.noderole.role == 'client' and base_client_addpkg|length > 0
- name: Installing additional packages for docenti role
apt:
pkg: '{{ item }}'
pkg: "{{ base_docenti_addpkg }}"
state: present
with_items: "{{ base_docenti_addpkg }}"
when: ansible_local.noderole.role == 'docenti' and base_docenti_addpkg|length > 0
- name: Correggo NetworkManager per gestire la rete
lineinfile:
dest: /etc/network/interfaces
regexp: "{{ item }}"
state: absent
when: ansible_product_name != "VirtualBox"
with_items:
- ^auto eth0
- ^iface eth0

View File

@ -8,5 +8,5 @@
state: absent
when: ansible_product_name != "VirtualBox"
with_items:
- '^auto eth0'
- '^iface eth0'
- '^auto {{ ansible_default_ipv4.interface }}'
- '^iface {{ ansible_default_ipv4.interface }}'

View File

@ -10,21 +10,27 @@
- name: Checking for a correct name
shell: cat /tmp/epoptes-srv
register: epo_srv_name
when: get_epo_srv_name|changed
when: get_epo_srv_name is changed
changed_when: "'none' not in epo_srv_name.stdout"
- name: Cleanup
file:
path: /tmp/epoptes-srv
state: absent
when: get_epo_srv_name|changed
when: get_epo_srv_name is changed
- name: Ensuring epoptes-client is installed
apt:
name: epoptes-client
state: present
when: get_epo_srv_name is changed
- name: Configuring the client
replace:
dest: /etc/default/epoptes-client
regexp: "^#SERVER=server"
replace: "SERVER={{ epo_srv_name.stdout }}"
when: epo_srv_name|changed
when: epo_srv_name is changed
- name: Checking for an already existent certificate
file:
@ -35,7 +41,7 @@
- name: Getting the epoptes server certificate
shell: /usr/sbin/epoptes-client -c
when: crt_epo_exists|failed
when: crt_epo_exists is failed
# I don't notify anymore, hoping that this would be done on first run after
# preseed and it should restart because of domain join.
#notify:

View File

@ -2,11 +2,10 @@
- name: Ensure needed packages are installed
apt:
name: "{{ item }}"
name:
- unattended-upgrades
- update-notifier-common
state: present
with_items:
- unattended-upgrades
- update-notifier-common
- name: Configuring unattended upgrades from file
copy:

View File

@ -1,6 +1,11 @@
---
# Managing Epoptes installation on 'docenti' role.
- name: Ensuring epoptes package has been installed
apt:
name: epoptes
state: present
- name: Configuring the Epoptes server
lineinfile:
dest: /etc/default/epoptes
@ -29,3 +34,19 @@
- name: Starting epoptes from upstart
shell: /sbin/start epoptes
when: epoptes_status.stdout.find("start/running") == -1
# Disabling ufw as per issue #12
- name: Disabling ufw by override
lineinfile:
path: /etc/init/ufw.override
line: "manual"
state: present
create: yes
owner: root
group: root
mode: 0644
- name: Stopping ufw
service:
name: ufw
state: stopped

View File

@ -1,4 +1,5 @@
---
dependencies:
- { role: base }
- { role: client }
- { role: docenti }

View File

@ -28,10 +28,18 @@
- name: Disabling pulseaudio startup on lightdm
shell: chmod -x /usr/bin/start-pulseaudio-x11
args:
warn: false
#- name: Adding pulseaudio fixing script at reboot.
# lineinfile:
# line: '@reboot root curl -sSL http://{{ ansible_local.domain.serverfqdn }}/ks/preseed/pulseaudio-perms.sh | bash >/dev/null 2>&1'
# dest: /etc/cron.d/pulseaudio-perms
# create: yes
# state: present
- name: Removing old (and not-working) approach
file:
path: /etc/cron.d/pulseaudio-perms
state: absent
- name: Get the new script
get_url:
url: "http://{{ ansible_local.domain.serverfqdn }}/ks/paperms/paperms.sh"
dest: /tmp/paperms.sh
- name: Run the script (install other support files and fixes the permissions)
shell: bash /tmp/paperms.sh

View File

@ -0,0 +1,11 @@
---
# Final tasks.
- name: Ensuring APT stack is healthy
shell: dpkg --configure -a && apt-get install -f
# Correctly managing ansible-pull runs.
- name: Updating local version for repo
shell: 'rm -f {{ ansible_local.checksum.repover_file }} && echo "{{ ansible_local.checksum.repover }}" > {{ ansible_local.checksum.repover_file }}'
args:
warn: false

View File

@ -9,7 +9,7 @@
- name: Joining domain
shell: 'net rpc join -U admin%{{ domainadminpasswd }}'
when: check_domain|changed
when: check_domain is changed
register: domainjoin
notify:
- reboot

View File

@ -24,4 +24,4 @@
- name: Recompiling glib2 schemas
shell: glib-compile-schemas --strict /usr/share/glib-2.0/schemas/
when: cfg_glib_users|changed or cfg_glib_mounted|changed or cfg_keyb_layout|changed
when: cfg_glib_users is changed or cfg_glib_mounted is changed or cfg_keyb_layout is changed

View File

@ -1,6 +1,11 @@
---
# Domain configurations
- include: networkmanager.yml
tags:
- domain
- networkmanager
- include: ntp.yml
tags:
- domain
@ -52,5 +57,7 @@
- domain
- join
- name: Updating local version for repo
shell: 'rm -f {{ ansible_local.checksum.repover_file }} && echo "{{ ansible_local.checksum.repover }}" > {{ ansible_local.checksum.repover_file }}'
- include: cleanup.yml
tags:
- domain
- cleanup

View File

@ -0,0 +1,21 @@
---
# Since students are disabling deliberately the network interface from
# NetworkManager, we insert the default interface in /etc/network/interfaces
# so they are not available to NM
- name: Ensuring first NIC will never be disabled again
lineinfile:
line: "{{ item }}"
state: present
dest: /etc/network/interfaces
insertafter: EOF
with_items:
- " "
- "auto {{ ansible_default_ipv4.interface }}"
- "iface {{ ansible_default_ipv4.interface }} inet dhcp"
# Hiding NetworkManager icon from any sessions
- name: Disabling NetworkManager from popping up in sessions
shell: mv /etc/xdg/autostart/nm-applet.desktop /etc/xdg/autostart/nm-applet.desktop.disabled
ignore_errors: yes

View File

@ -26,4 +26,4 @@
- name: Restarting NTP service
shell: service ntp restart
when: cfg_ntp|changed
when: cfg_ntp is changed

View File

@ -18,19 +18,18 @@
ignore_errors: yes
changed_when: "'2:4.1.6+dfsg-1ubuntu2' not in check_samba_version.stdout"
#- name: Downgrading SAMBA if not the right version
# shell: "/var/lib/{{ ansible_local.domain.domainfull }}/bin/downgrade_samba.sh"
# when: check_samba_version|changed
#
#- name: Checking again for the correct SAMBA version
# shell: dpkg -l | grep libsmbclient
# register: recheck_samba_version
# changed_when: "'2:4.1.6+dfsg-1ubuntu2' in check_samba_version.stdout"
- name: Downgrading SAMBA if not the right version
shell: "/var/lib/{{ ansible_local.domain.domainfull }}/bin/downgrade_samba.sh"
when: check_samba_version|changed
- name: Checking again for the correct SAMBA version
shell: dpkg -l | grep libsmbclient
register: recheck_samba_version
changed_when: "'2:4.1.6+dfsg-1ubuntu2' in check_samba_version.stdout"
- name: Installing domain packages
apt:
pkg: '{{ item }}'
pkg:
- winbind
- samba
state: present
with_items:
- winbind
- samba

View File

@ -17,11 +17,11 @@
- name: SAMBA restart
shell: /sbin/restart smbd
when: cfg_samba|changed
when: cfg_samba is changed
- name: Winbind restart
shell: /sbin/restart winbind
when: cfg_samba|changed
when: cfg_samba is changed
- name: Creating home base
file:

View File

@ -18,7 +18,7 @@
- name: Adding certificates to the ones used by the system
shell: update-ca-certificates
when: proxycrt_dwnl|changed
when: proxycrt_dwnl is changed
- name: Firefox settings to include certificate
get_url:

View File

@ -45,6 +45,4 @@ post-start script
chown pulse:pulse-access /var/run/pulse/.pulse-cookie
chmod 640 /var/run/pulse/.pulse-cookie
fi
# Run script to fix permissions on the pulseaudio stack
/usr/bin/curl -sSL http://{{ ansible_local.domain.serverfqdn }}/ks/preseed/pulseaudio-perms.sh | /bin/bash >/dev/null 2>&1 &
end script

View File

@ -7,18 +7,18 @@
- name: Installing packages for specific role from NetworkPackageManager
apt:
name: '{{ item }}'
name: "{{ ansible_local.noderole.addpkg }}"
state: present
with_items: "{{ ansible_local.noderole.addpkg }}"
when: ansible_local.noderole.addpkg is defined and ansible_local.noderole.addpkg|join(' ')|trim != ''
- name: Removing packages for specific role from NetworkPackageManager
apt:
name: '{{ item }}'
name: "{{ ansible_local.noderole.delpkg }}"
state: absent
purge: yes
with_items: "{{ ansible_local.noderole.delpkg }}"
when: ansible_local.noderole.delpkg is defined and ansible_local.noderole.delpkg|join(' ')|trim != ''
- name: Updating local hash for packages
shell: 'rm -f {{ ansible_local.checksum.pkgver_file }} && echo "{{ ansible_local.checksum.pkgver }}" > {{ ansible_local.checksum.pkgver_file }}'
args:
warn: false

View File

@ -0,0 +1,42 @@
#!/bin/bash
# Define a fix name. This will be used to check if the fix was already
# applied.
name=samba-downgrade_20161124.sh
# If already applied, skip
if [[ -f "/var/lib/topolin.ia/fixes/${name}.done" ]]; then
echo "Already fixed with ${name}. Skipping."
exit 0
fi
# Make the required modifications.
export DEBIAN_FRONTEND=noninteractive
apt-get install -q -y --force-yes \
-o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" \
libsmbclient=2:4.3.11+dfsg-0ubuntu0.14.04.1 \
python-samba=2:4.3.11+dfsg-0ubuntu0.14.04.1 \
samba=2:4.3.11+dfsg-0ubuntu0.14.04.1 \
samba-common=2:4.3.11+dfsg-0ubuntu0.14.04.1 \
samba-common-bin=2:4.3.11+dfsg-0ubuntu0.14.04.1 \
samba-dsdb-modules=2:4.3.11+dfsg-0ubuntu0.14.04.1 \
samba-libs=2:4.3.11+dfsg-0ubuntu0.14.04.1 \
samba-vfs-modules=2:4.3.11+dfsg-0ubuntu0.14.04.1 \
smbclient=2:4.3.11+dfsg-0ubuntu0.14.04.1 \
libnss-winbind=2:4.3.11+dfsg-0ubuntu0.14.04.1 \
libpam-winbind=2:4.3.11+dfsg-0ubuntu0.14.04.1 \
libwbclient0=2:4.3.11+dfsg-0ubuntu0.14.04.1 \
winbind=2:4.3.11+dfsg-0ubuntu0.14.04.1
pkglist="libsmbclient python-samba samba-common samba-common-bin samba-dsdb-modules samba-libs samba-vfs-modules smbclient libnss-winbind libpam-winbind libwbclient0"
for pkg in ${pkglist}; do
apt-mark auto ${pkg}
apt-mark hold ${pkg}
done
# Once modified the system, ensure to create a check file to skip and not run
# it again if not needed.
mkdir -p /var/lib/topolin.ia/fixes
echo "$(date --iso | tr -d '-')" > /var/lib/topolin.ia/fixes/${name}.done

View File

@ -0,0 +1,20 @@
---
# Permits to apply per-site signed fixes automatically
#
# Prepare a script file, then crypt it with the Domain Administrator password:
# gpg -r info@bglug.it --symmetric --encrypt script.sh > script.sh.gpg
#
# Put the script within the server directory /var/lib/nethserver/ibay/ks/fixes
#
# List the file within domain.yml:
# apply_fixes:
# - script.sh.gpg
#
# Please see roles/prereq/files/samba-downgrade_20161124.sh as a template.
#
- name: Applying local signed fixes
shell: "/usr/bin/curl -sSL http://{{ ansible_local.domain.serverfqdn }}/ks/fixes/{{ item }} | /usr/bin/gpg --passphrase {{ domainadminpasswd }} --decrypt | sudo /bin/bash"
args:
warn: false
with_items: "{{ ansible_local.domain.apply_fixes|default([]) }}"

View File

@ -10,3 +10,9 @@
tags:
- prereq
- repos
- include: fixes.yml
tags:
- prereq
- fixes
when: ansible_local.domain.apply_fixes is defined

View File

@ -1,5 +1,8 @@
---
- name: Fixing APT issues, every time.
shell: dpkg --configure -a && apt-get install -f
- name: Domain settings download
get_url:
url: "http://{{ ansible_default_ipv4.gateway }}:3000/domain"

View File

@ -8,6 +8,51 @@
dest: /etc/apt/sources.list
force: yes
- name: Checking for libreoffice PPA GPG key
shell: apt-key list | grep -q 1378B444
register: check_gpg_libreoffice
ignore_errors: yes
- name: Installing libreoffice PPA GPG key
shell: apt-key adv --keyserver keyserver.ubuntu.com --recv 1378B444
when: check_gpg_libreoffice is failed
- name: Checking for ansible PPA GPG key
shell: apt-key list | grep -q 7BB9C367
register: check_gpg_ansible
ignore_errors: yes
- name: Installing ansible PPA GPG key
shell: apt-key adv --keyserver keyserver.ubuntu.com --recv 7BB9C367
when: check_gpg_ansible is failed
- name: Checking for epoptes PPA GPG key
shell: apt-key list | grep -q 0350B375
register: check_gpg_epoptes
ignore_errors: yes
- name: Installing epoptes PPA GPG key
shell: apt-key adv --keyserver keyserver.ubuntu.com --recv 0350B375
when: check_gpg_epoptes is failed
- name: Checking for geogebra GPG key
shell: apt-key list | grep -q 83A736CF
register: check_gpg_geogebra
ignore_errors: yes
- name: Installing geogebra GPG key
shell: apt-key adv --keyserver keyserver.ubuntu.com --recv 83A736CF
when: check_gpg_geogebra is failed
- name: Removing old repositories (if present)
file:
path: "{{ item }}"
state: absent
with_items:
- ansible.list
- geogebra.list
- libreoffice.list
- name: Adding additional repositories
get_url:
url: "http://{{ ansible_local.domain.serverfqdn }}/ks/repoconfig/{{ item }}"
@ -16,6 +61,8 @@
with_items:
- ansible-ansible-trusty.list
- libreoffice-ppa-trusty.list
- epoptes-ppa-trusty.list
- geogebra-stable.list
- bglug-trusty.list
- name: Updating package database