Compare commits

..

8 Commits

12 changed files with 136 additions and 33 deletions

View File

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

View File

@ -49,13 +49,3 @@
state: present state: present
with_items: "{{ base_docenti_addpkg }}" with_items: "{{ base_docenti_addpkg }}"
when: ansible_local.noderole.role == 'docenti' and base_docenti_addpkg|length > 0 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 state: absent
when: ansible_product_name != "VirtualBox" when: ansible_product_name != "VirtualBox"
with_items: with_items:
- '^auto eth0' - '^auto {{ ansible_default_ipv4.interface }}'
- '^iface eth0' - '^iface {{ ansible_default_ipv4.interface }}'

View File

@ -19,6 +19,12 @@
state: absent state: absent
when: get_epo_srv_name|changed 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 - name: Configuring the client
replace: replace:
dest: /etc/default/epoptes-client dest: /etc/default/epoptes-client

View File

@ -1,6 +1,11 @@
--- ---
# Managing Epoptes installation on 'docenti' role. # Managing Epoptes installation on 'docenti' role.
- name: Ensuring epoptes package has been installed
apt:
name: epoptes
state: present
- name: Configuring the Epoptes server - name: Configuring the Epoptes server
lineinfile: lineinfile:
dest: /etc/default/epoptes dest: /etc/default/epoptes
@ -29,3 +34,19 @@
- name: Starting epoptes from upstart - name: Starting epoptes from upstart
shell: /sbin/start epoptes shell: /sbin/start epoptes
when: epoptes_status.stdout.find("start/running") == -1 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

@ -29,9 +29,9 @@
- name: Disabling pulseaudio startup on lightdm - name: Disabling pulseaudio startup on lightdm
shell: chmod -x /usr/bin/start-pulseaudio-x11 shell: chmod -x /usr/bin/start-pulseaudio-x11
#- name: Adding pulseaudio fixing script at reboot. - name: Adding pulseaudio fixing script at reboot.
# lineinfile: lineinfile:
# line: '@reboot root curl -sSL http://{{ ansible_local.domain.serverfqdn }}/ks/preseed/pulseaudio-perms.sh | bash >/dev/null 2>&1' 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 dest: /etc/cron.d/pulseaudio-perms
# create: yes create: yes
# state: present state: present

View 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 }}'

View File

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

View 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

View File

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

View File

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

View File

@ -8,6 +8,51 @@
dest: /etc/apt/sources.list dest: /etc/apt/sources.list
force: yes 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 - name: Adding additional repositories
get_url: get_url:
url: "http://{{ ansible_local.domain.serverfqdn }}/ks/repoconfig/{{ item }}" url: "http://{{ ansible_local.domain.serverfqdn }}/ks/repoconfig/{{ item }}"
@ -16,6 +61,8 @@
with_items: with_items:
- ansible-ansible-trusty.list - ansible-ansible-trusty.list
- libreoffice-ppa-trusty.list - libreoffice-ppa-trusty.list
- epoptes-ppa-trusty.list
- geogebra-stable.list
- bglug-trusty.list - bglug-trusty.list
- name: Updating package database - name: Updating package database