Compare commits
38 Commits
Author | SHA1 | Date | |
---|---|---|---|
d0c5109586 | |||
b40ddd873b | |||
099af70925 | |||
e45c72de4d | |||
c5dbaf38e1 | |||
cf30fbe2e6 | |||
36ca2d681a | |||
f7b222e499 | |||
8112fd3866 | |||
2be2790e52 | |||
959846ae46 | |||
ed5010fe9a | |||
0626b20e85 | |||
156a3b5c01 | |||
f12da6547d | |||
57c5e8051c | |||
1a02b94ccb | |||
c02e481d80 | |||
550dd29b47 | |||
b4e45bc77d | |||
e6ac8c5c27 | |||
f7ef8be227 | |||
e579aad2be | |||
65fa352717 | |||
ac221f15ad | |||
d2a3f9685a | |||
c273c5c8fb | |||
5b7dd1c793 | |||
7099a80079 | |||
fb642d6ab6 | |||
f107b4dc82 | |||
9d9a8b39d3 | |||
49a46ed02c | |||
1a3df4e77c | |||
36ce4921c9 | |||
b24ff670e8 | |||
144c4b7f08 | |||
221b795941 |
@ -1,7 +1,7 @@
|
||||
$ANSIBLE_VAULT;1.1;AES256
|
||||
36333564653138626465303239313536396663303831346364336264343763323932666162303730
|
||||
3136363537366130643335613763303932323235383435660a323164663663373632303161356530
|
||||
36366565323134656562366639366237316635646262666162363436363135303839353163656161
|
||||
3566653133616163630a363364303061326433616565613662313765306532316339363734666631
|
||||
38613865366133663639643930633063653339373035313764623862613237623762396564333466
|
||||
3163663439393238373331666534363335326633336661323763
|
||||
34656463636239626332366464373337386539643933653433653362613238666330636334323465
|
||||
6666373739386430643330666238366237646365623634370a363530303762373036616332313966
|
||||
31343339373532346538393164373037396135633631653133663862316161373566633938386234
|
||||
6366613030386432320a313262383838663262373037643138616131343337626234306436323462
|
||||
64333262663662353836303365316433353463326664623838353339376164313235363339313238
|
||||
3865613230306436346365623338366564346633343565623964
|
||||
|
@ -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
|
||||
|
@ -1,20 +0,0 @@
|
||||
---
|
||||
# Manage Repository changes (but only for physical machines)
|
||||
|
||||
- name: Change repository sources
|
||||
template:
|
||||
src: sources.list
|
||||
dest: /etc/apt/sources.list
|
||||
when: ansible_product_name != "VirtualBox"
|
||||
|
||||
- name: Adding/changing ansible ppa local mirror
|
||||
get_url:
|
||||
url: "http://{{ ansible_local.domain.serverfqdn }}/ks/ansible-ansible-trusty.list"
|
||||
dest: /etc/apt/sources.list.d/ansible-ansible-trusty.list
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
when: ansible_product_name != "VirtualBox"
|
||||
|
||||
- name: Updating package database
|
||||
apt: update_cache=yes
|
@ -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
|
||||
|
@ -5,11 +5,6 @@
|
||||
|
||||
# Requires fact execpath, already set by prereq role.
|
||||
|
||||
- include: apt-sources.yml
|
||||
tags:
|
||||
- base
|
||||
- apt-sources
|
||||
|
||||
- include: virtualbox-guest-addons.yml
|
||||
tags:
|
||||
- base
|
||||
@ -32,11 +27,6 @@
|
||||
- pkgs
|
||||
- packages
|
||||
|
||||
#- include: audio.yml
|
||||
# tags:
|
||||
# - base
|
||||
# - audio
|
||||
|
||||
- include: system.yml
|
||||
tags:
|
||||
- base
|
||||
|
@ -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
|
||||
|
@ -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 }}'
|
||||
|
@ -1,2 +0,0 @@
|
||||
deb http://{{ execpath }}ppa.launchpad.net/ansible/ansible/ubuntu trusty main
|
||||
# deb-src http://{{ execpath }}ppa.launchpad.net/ansible/ansible/ubuntu trusty main
|
@ -1,56 +0,0 @@
|
||||
#deb cdrom:[Edubuntu 14.04 LTS _Trusty Tahr_ - Release i386 (20140417)]/ trusty main multiverse restricted universe
|
||||
|
||||
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
|
||||
# newer versions of the distribution.
|
||||
deb http://{{ execpath }}archive.ubuntu.com/ubuntu/ trusty main restricted
|
||||
deb-src http://{{ execpath }}archive.ubuntu.com/ubuntu/ trusty main restricted
|
||||
|
||||
## Major bug fix updates produced after the final release of the
|
||||
## distribution.
|
||||
deb http://{{ execpath }}archive.ubuntu.com/ubuntu/ trusty-updates main restricted
|
||||
deb-src http://{{ execpath }}archive.ubuntu.com/ubuntu/ trusty-updates main restricted
|
||||
|
||||
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
|
||||
## team. Also, please note that software in universe WILL NOT receive any
|
||||
## review or updates from the Ubuntu security team.
|
||||
deb http://{{ execpath }}archive.ubuntu.com/ubuntu/ trusty universe
|
||||
deb-src http://{{ execpath }}archive.ubuntu.com/ubuntu/ trusty universe
|
||||
deb http://{{ execpath }}archive.ubuntu.com/ubuntu/ trusty-updates universe
|
||||
deb-src http://{{ execpath }}archive.ubuntu.com/ubuntu/ trusty-updates universe
|
||||
|
||||
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
|
||||
## team, and may not be under a free licence. Please satisfy yourself as to
|
||||
## your rights to use the software. Also, please note that software in
|
||||
## multiverse WILL NOT receive any review or updates from the Ubuntu
|
||||
## security team.
|
||||
deb http://{{ execpath }}archive.ubuntu.com/ubuntu/ trusty multiverse
|
||||
deb-src http://{{ execpath }}archive.ubuntu.com/ubuntu/ trusty multiverse
|
||||
deb http://{{ execpath }}archive.ubuntu.com/ubuntu/ trusty-updates multiverse
|
||||
deb-src http://{{ execpath }}archive.ubuntu.com/ubuntu/ trusty-updates multiverse
|
||||
|
||||
## N.B. software from this repository may not have been tested as
|
||||
## extensively as that contained in the main release, although it includes
|
||||
## newer versions of some applications which may provide useful features.
|
||||
## Also, please note that software in backports WILL NOT receive any review
|
||||
## or updates from the Ubuntu security team.
|
||||
deb http://{{ execpath }}archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
|
||||
deb-src http://{{ execpath }}archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
|
||||
|
||||
deb http://{{ execpath }}security.ubuntu.com/ubuntu trusty-security main restricted
|
||||
deb-src http://{{ execpath }}security.ubuntu.com/ubuntu trusty-security main restricted
|
||||
deb http://{{ execpath }}security.ubuntu.com/ubuntu trusty-security universe
|
||||
deb-src http://{{ execpath }}security.ubuntu.com/ubuntu trusty-security universe
|
||||
deb http://{{ execpath }}security.ubuntu.com/ubuntu trusty-security multiverse
|
||||
deb-src http://{{ execpath }}security.ubuntu.com/ubuntu trusty-security multiverse
|
||||
|
||||
## Uncomment the following two lines to add software from Canonical's
|
||||
## 'partner' repository.
|
||||
## This software is not part of Ubuntu, but is offered by Canonical and the
|
||||
## respective vendors as a service to Ubuntu users.
|
||||
# deb http://{{ execpath }}archive.canonical.com/ubuntu trusty partner
|
||||
# deb-src http://{{ execpath }}archive.canonical.com/ubuntu trusty partner
|
||||
|
||||
## This software is not part of Ubuntu, but is offered by third-party
|
||||
## developers who want to ship their latest software.
|
||||
deb http://{{ execpath }}extras.ubuntu.com/ubuntu trusty main
|
||||
deb-src http://{{ execpath }}extras.ubuntu.com/ubuntu trusty main
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
|
||||
- name: reboot
|
||||
shell: shutdown -r now "Reboot by Ansible."
|
||||
shell: /sbin/shutdown -r now "Reboot by Ansible."
|
||||
async: 0
|
||||
poll: 0
|
||||
|
@ -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:
|
||||
|
@ -2,11 +2,10 @@
|
||||
|
||||
- name: Ensure needed packages are installed
|
||||
apt:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items:
|
||||
name:
|
||||
- unattended-upgrades
|
||||
- update-notifier-common
|
||||
state: present
|
||||
|
||||
- name: Configuring unattended upgrades from file
|
||||
copy:
|
||||
|
@ -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
|
||||
@ -9,6 +14,7 @@
|
||||
|
||||
- name: Stopping epoptes SysV daemon
|
||||
shell: /etc/init.d/epoptes stop
|
||||
ignore_errors: yes
|
||||
|
||||
- name: Disabling sysv start
|
||||
shell: /usr/sbin/update-rc.d -f epoptes remove
|
||||
@ -28,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
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
|
||||
- name: reboot
|
||||
shell: shutdown -r now "Reboot by Ansible."
|
||||
shell: /sbin/shutdown -r now "Reboot by Ansible."
|
||||
async: 0
|
||||
poll: 0
|
||||
|
@ -1,4 +1,5 @@
|
||||
---
|
||||
dependencies:
|
||||
- { role: base }
|
||||
- { role: client }
|
||||
- { role: docenti }
|
||||
|
@ -1,11 +1,13 @@
|
||||
---
|
||||
# Manages reactivation of pulseaudio as system daemon
|
||||
|
||||
- name: "Allowing pulseaudio to run at startup"
|
||||
replace:
|
||||
regexp: '^#start on runlevel'
|
||||
replace: 'start on runlevel [2345]'
|
||||
- name: "Changing pulseaudio upstart script"
|
||||
template:
|
||||
src: pulseaudio.conf
|
||||
dest: /etc/init/pulseaudio.conf
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
- name: "Checking if pulseaudio is started"
|
||||
shell: /sbin/status pulseaudio
|
||||
@ -26,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
|
||||
|
11
roles/domain/tasks/cleanup.yml
Normal file
11
roles/domain/tasks/cleanup.yml
Normal 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
|
12
roles/domain/tasks/disable-upgrade-notifications.yml
Normal file
12
roles/domain/tasks/disable-upgrade-notifications.yml
Normal file
@ -0,0 +1,12 @@
|
||||
---
|
||||
- name: Removing upgrade-notification from /etc
|
||||
lineinfile:
|
||||
dest: /etc/update-manager/release-upgrades
|
||||
line: "Prompt=never"
|
||||
regexp: '^Prompt='
|
||||
state: present
|
||||
|
||||
- name: Removing notifications for system upgrade
|
||||
shell: >
|
||||
test -f /usr/share/upstart/sessions/update-notifier-release.conf && mv /usr/share/upstart/sessions/update-notifier-release.conf /usr/share/upstart/sessions/update-notifier-release.conf.disabled
|
||||
ignore_errors: yes
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -9,3 +9,6 @@
|
||||
|
||||
- include: policykit-1.yml
|
||||
tags: policykit
|
||||
|
||||
- include: disable-upgrade-notifications.yml
|
||||
tags: disable-upgrade-notifications
|
||||
|
@ -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
|
||||
|
21
roles/domain/tasks/networkmanager.yml
Normal file
21
roles/domain/tasks/networkmanager.yml
Normal 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
|
@ -26,4 +26,4 @@
|
||||
|
||||
- name: Restarting NTP service
|
||||
shell: service ntp restart
|
||||
when: cfg_ntp|changed
|
||||
when: cfg_ntp is changed
|
||||
|
@ -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 is 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 }}'
|
||||
state: present
|
||||
with_items:
|
||||
pkg:
|
||||
- winbind
|
||||
- samba
|
||||
state: present
|
||||
|
@ -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:
|
||||
|
@ -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:
|
||||
|
48
roles/domain/templates/pulseaudio.conf
Normal file
48
roles/domain/templates/pulseaudio.conf
Normal file
@ -0,0 +1,48 @@
|
||||
# System PulseAudio service
|
||||
|
||||
description "System PulseAudio sound server"
|
||||
author "Pali Rohár <pali.rohar@gmail.com>"
|
||||
|
||||
# uncomment the 'start on' to start pulseaudio in system mode
|
||||
# (enables the pulseaudio init script - requires that users be in the
|
||||
# pulse-access group)
|
||||
# System mode is not the recommended way to run PulseAudio as it has some
|
||||
# limitations (such as no shared memory access) and could potentially allow
|
||||
# users to disconnect or redirect each others' audio streams. The
|
||||
# recommended way to run PulseAudio is as a per-session daemon. For GNOME/KDE/
|
||||
# Xfce sessions in Ubuntu Lucid/10.04, /etc/xdg/autostart/pulseaudio.desktop
|
||||
# handles this function of automatically starting PulseAudio on login, and for
|
||||
# it to work correctly your user must *not* have "autospawn = no" set in
|
||||
# ~/.pulse/client.conf (or in /etc/pulse/client.conf). By default, autospawn
|
||||
# is enabled. For other sessions, you can simply start PulseAudio with
|
||||
# "pulseaudio --daemonize".
|
||||
|
||||
start on (started winbind)
|
||||
stop on runlevel [016]
|
||||
|
||||
expect daemon
|
||||
respawn
|
||||
|
||||
# Prevent users from dynamically loading modules into the PulseAudio sound
|
||||
# server. Dynamic module loading enhances the flexibility of the PulseAudio
|
||||
# system, but may pose a security risk.
|
||||
# 0 = no, 1 = yes
|
||||
env DISALLOW_MODULE_LOADING=1
|
||||
|
||||
# extra arguments to pass to the daemon
|
||||
env PULSEAUDIO_ARGS=
|
||||
|
||||
pre-start exec install -d -m755 -o pulse -g pulse /run/pulse
|
||||
|
||||
exec /usr/bin/pulseaudio --system --daemonize --high-priority --log-target=syslog --disallow-exit --disallow-module-loading=$DISALLOW_MODULE_LOADING $PULSEAUDIO_ARGS
|
||||
|
||||
post-start script
|
||||
if [ -e /var/run/pulse/.esd_auth ]; then
|
||||
chown pulse:pulse-access /var/run/pulse/.esd_auth
|
||||
chmod 640 /var/run/pulse/.esd_auth
|
||||
fi
|
||||
if [ -e /var/run/pulse/.pulse-cookie ]; then
|
||||
chown pulse:pulse-access /var/run/pulse/.pulse-cookie
|
||||
chmod 640 /var/run/pulse/.pulse-cookie
|
||||
fi
|
||||
end script
|
@ -6,13 +6,11 @@
|
||||
workgroup = {{ ansible_local.domain.domainshort }}
|
||||
idmap uid = 10000000-19999999
|
||||
idmap gid = 10000000-19999999
|
||||
winbind enum users = yes
|
||||
winbind enum groups = yes
|
||||
winbind use default domain = yes
|
||||
winbind enum users = no
|
||||
winbind enum groups = no
|
||||
winbind use default domain = yes
|
||||
winbind expand groups = 1
|
||||
template shell = /bin/bash
|
||||
template homedir = /home/%D/%U
|
||||
domain master = no
|
||||
winbind enum users = yes
|
||||
winbind enum groups = yes
|
||||
add machine script = /usr/sbin/useradd -d /var/lib/nobody -g 100 -s /bin/false -M %u
|
||||
|
@ -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
|
||||
|
42
roles/prereq/files/samba-downgrade_20161124.sh
Normal file
42
roles/prereq/files/samba-downgrade_20161124.sh
Normal 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
|
20
roles/prereq/tasks/fixes.yml
Normal file
20
roles/prereq/tasks/fixes.yml
Normal 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([]) }}"
|
@ -10,3 +10,9 @@
|
||||
tags:
|
||||
- prereq
|
||||
- repos
|
||||
|
||||
- include: fixes.yml
|
||||
tags:
|
||||
- prereq
|
||||
- fixes
|
||||
when: ansible_local.domain.apply_fixes is defined
|
||||
|
@ -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"
|
||||
|
@ -2,22 +2,68 @@
|
||||
# Fixing all the stuff around repositories.
|
||||
|
||||
# Provide a clean and ordered sources.list
|
||||
- name: Replace sources.list with a clean one.
|
||||
template:
|
||||
src: sources.list
|
||||
- name: Change main repositories
|
||||
get_url:
|
||||
url: "http://{{ ansible_local.domain.serverfqdn }}/ks/repoconfig/sources.list"
|
||||
dest: /etc/apt/sources.list
|
||||
force: yes
|
||||
|
||||
- name: Adding Ansible repo
|
||||
template:
|
||||
src: ansible.list
|
||||
dest: /etc/apt/sources.list.d/ansible.list
|
||||
- name: Checking for libreoffice PPA GPG key
|
||||
shell: apt-key list | grep -q 1378B444
|
||||
register: check_gpg_libreoffice
|
||||
ignore_errors: yes
|
||||
|
||||
- name: Adding LibreOffice repo
|
||||
template:
|
||||
src: libreoffice.list
|
||||
dest: /etc/apt/sources.list.d/libreoffice.list
|
||||
- name: Installing libreoffice PPA GPG key
|
||||
shell: apt-key adv --keyserver keyserver.ubuntu.com --recv 1378B444
|
||||
when: check_gpg_libreoffice is failed
|
||||
|
||||
- name: Adding BgLUG repo
|
||||
template:
|
||||
src: bglug.list
|
||||
dest: /etc/apt/sources.list.d/bglug.list
|
||||
- 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 }}"
|
||||
dest: "/etc/apt/sources.list.d/{{ item }}"
|
||||
force: yes
|
||||
with_items:
|
||||
- ansible-ansible-trusty.list
|
||||
- libreoffice-ppa-trusty.list
|
||||
- epoptes-ppa-trusty.list
|
||||
- geogebra-stable.list
|
||||
- bglug-trusty.list
|
||||
|
||||
- name: Updating package database
|
||||
apt: update_cache=yes
|
||||
|
@ -1,2 +0,0 @@
|
||||
## Ansible Official PPA
|
||||
deb http://{{ execpath }}ppa.launchpad.net/ansible/ansible/ubuntu trusty main
|
@ -1,2 +0,0 @@
|
||||
# BgLUG repo
|
||||
deb http://{{ execpath }}repo.bglug.it/ubuntu trusty main
|
@ -1,2 +0,0 @@
|
||||
## LibreOffice Official PPA
|
||||
deb http://{{ execpath }}ppa.launchpad.net/libreoffice/libreoffice-5-0/ubuntu trusty main
|
@ -1,19 +0,0 @@
|
||||
# Base
|
||||
deb http://{{ execpath }}archive.ubuntu.com/ubuntu trusty main restricted universe multiverse
|
||||
deb-src http://{{ execpath }}archive.ubuntu.com/ubuntu trusty main restricted universe multiverse
|
||||
|
||||
# updates
|
||||
deb http://{{ execpath }}archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse
|
||||
deb-src http://{{ execpath }}archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse
|
||||
|
||||
# backports
|
||||
deb http://{{ execpath }}archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse
|
||||
deb-src http://{{ execpath }}archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse
|
||||
|
||||
# security
|
||||
deb http://{{ execpath }}security.ubuntu.com/ubuntu trusty-security main restricted universe multiverse
|
||||
deb-src http://{{ execpath }}security.ubuntu.com/ubuntu trusty-security main restricted universe multiverse
|
||||
|
||||
# extras
|
||||
deb http://{{ execpath }}extras.ubuntu.com/ubuntu trusty main
|
||||
deb-src http://{{ execpath }}extras.ubuntu.com/ubuntu trusty main
|
Loading…
x
Reference in New Issue
Block a user