Compare commits
9 Commits
2e594dcf5d
...
0626b20e85
Author | SHA1 | Date | |
---|---|---|---|
0626b20e85 | |||
156a3b5c01 | |||
f12da6547d | |||
57c5e8051c | |||
1a02b94ccb | |||
c02e481d80 | |||
550dd29b47 | |||
b4e45bc77d | |||
e6ac8c5c27 |
@ -49,13 +49,3 @@
|
||||
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 }}'
|
||||
|
@ -19,6 +19,12 @@
|
||||
state: absent
|
||||
when: get_epo_srv_name|changed
|
||||
|
||||
- name: Ensuring epoptes-client is installed
|
||||
apt:
|
||||
name: epoptes-client
|
||||
state: present
|
||||
when: get_epo_srv_name|changed
|
||||
|
||||
- name: Configuring the client
|
||||
replace:
|
||||
dest: /etc/default/epoptes-client
|
||||
|
@ -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
|
||||
|
@ -29,9 +29,9 @@
|
||||
- name: Disabling pulseaudio startup on lightdm
|
||||
shell: chmod -x /usr/bin/start-pulseaudio-x11
|
||||
|
||||
#- 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: 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
|
||||
|
9
roles/domain/tasks/cleanup.yml
Normal file
9
roles/domain/tasks/cleanup.yml
Normal file
@ -0,0 +1,9 @@
|
||||
---
|
||||
# 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 }}'
|
@ -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
|
||||
|
19
roles/domain/tasks/networkmanager.yml
Normal file
19
roles/domain/tasks/networkmanager.yml
Normal file
@ -0,0 +1,19 @@
|
||||
---
|
||||
# Fixing NetworkManager issues.
|
||||
|
||||
- name: Ensuring first NIC will never be disabled again
|
||||
lineinfile:
|
||||
line: "{{ item }}"
|
||||
state: present
|
||||
dest: /etc/network/interfaces
|
||||
insertafter: EOF
|
||||
with_items:
|
||||
- " "
|
||||
- "auto eth0"
|
||||
- "iface eth0 inet dhcp"
|
||||
|
||||
# Hiding icon for 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
|
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
|
18
roles/prereq/tasks/fixes.yml
Normal file
18
roles/prereq/tasks/fixes.yml
Normal file
@ -0,0 +1,18 @@
|
||||
---
|
||||
# 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"
|
||||
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"
|
||||
|
@ -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|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|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|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|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
|
||||
|
Loading…
x
Reference in New Issue
Block a user