library/roles/rstudio-server/tasks/main.yml: Install the apparmor utilities and set the rstudio server binary to 'complain' from 'enforce' so that it can read the nlscd socket.

This commit is contained in:
Andrea Dell'Amico 2017-03-20 23:00:55 +01:00
parent e1d61ac8c9
commit de9a69c7c5
1 changed files with 9 additions and 0 deletions

View File

@ -3,6 +3,10 @@
- name: Install the gdebi tool - name: Install the gdebi tool
apt: pkg=gdebi-core state=latest update_cache=yes cache_valid_time=1800 apt: pkg=gdebi-core state=latest update_cache=yes cache_valid_time=1800
- name: Install the apparmor utilities
apt: pkg=apparmor-utils state=present update_cache=yes cache_valid_time=1800
tags: [ 'rstudio', 'rstudio_server', 'apparmor' ]
- name: Download the rstudio server deb package - name: Download the rstudio server deb package
# get_url: url={{ rstudio_download_url }} dest=/srv/{{ rstudio_file }} # get_url: url={{ rstudio_download_url }} dest=/srv/{{ rstudio_file }}
shell: cd /srv ; wget {{ rstudio_download_url }} shell: cd /srv ; wget {{ rstudio_download_url }}
@ -15,6 +19,11 @@
command: gdebi -n -q /srv/{{ rstudio_file }} command: gdebi -n -q /srv/{{ rstudio_file }}
when: ( rstudio_download | changed ) when: ( rstudio_download | changed )
- name: Change the apparmor behaviour to complain, otherwise it cannot read the nslcd socket
shell: if [ -x /usr/sbin/apparmor_status ] ; then RETVAL=$( /usr/sbin/apparmor_status ) ; if [ $RETVAL -eq 0 ] ; then aa-complain /usr/lib/rstudio-server/bin/rserver ; fi ; fi
when: rstudio_enabled
tags: [ 'rstudio', 'rstudio_server', 'apparmor' ]
- name: Ensure that rstudio server is enabled and running - name: Ensure that rstudio server is enabled and running
service: name=rstudio-server state=started enabled=yes service: name=rstudio-server state=started enabled=yes
when: rstudio_enabled when: rstudio_enabled