--- - block: - name: Remove the installed R connector file: dest={{ item }} state=absent with_items: - '{{ smartgears_instance_path }}/webapps/{{ r_connector_name }}' - '{{ smartgears_instance_path }}/webapps/{{ r_connector_name }}.{{ r_connector_extension }}' notify: Restart smartgears - name: Remove the packages required to enable the LDAP PAM authentication become_user: root apt: pkg={{ item }} state=absent with_items: '{{ r_connector_deb_pkgs }}' - name: Remove the connector raddusers and rconnector_unmount scripts become_user: root file: dest={{ item }} state=absent with_items: - '{{ r_connector_adduserscript }}' - '{{ r_connector_workspace_unmount }}' - name: Remove the RConfiguration repo file: dest={{ r_connector_rprofile_path }} state=absent - name: Remove the cron job that regulary updates the Rprofile cron: name="Update the RStudioConfiguration repo" job="cd {{ r_connector_rprofile_path }} ; svn update >/dev/null 2>&1" state=absent become: True become_user: '{{ smartgears_user }}' when: not r_connector_install tags: [ 'smartgears', 'r_connector', 'tomcat' ] - block: - name: Get the R Connector war maven_artifact: artifact_id={{ r_connector_name }} version={{ r_connector_ver | default('latest') }} group_id={{ r_connector_group_id }} extension={{ r_connector_extension }} repository_url={{ smartgears_global_base_url }} dest={{ smartgears_downloads_dir }}/{{ r_connector_filename }} verify_checksum=always register: r_connector_download - name: Remove the installed R connector before upgrading file: dest={{ item }} state=absent with_items: - '{{ smartgears_instance_path }}/webapps/{{ r_connector_name }}' - '{{ smartgears_instance_path }}/webapps/{{ r_connector_name }}.{{ r_connector_extension }}' notify: Restart smartgears when: r_connector_download is changed - name: Create the R connector webapp directory file: dest={{ smartgears_instance_path }}/webapps/{{ r_connector_name }} state=directory when: r_connector_download is changed - name: Unarchive the R connector war file unarchive: copy=no src={{ smartgears_downloads_dir }}/{{ r_connector_filename }} dest={{ smartgears_instance_path }}/webapps/{{ r_connector_name }} args: creates: '{{ smartgears_instance_path }}/webapps/{{ r_connector_name }}/WEB-INF/web.xml' notify: Restart smartgears - name: Obtain the permission to read the Rstudio secure cookie key become_user: root file: dest={{ r_connector_rstudio_cookie_key }} mode=640 group={{ smartgears_user }} - name: Install the R connector web.xml template template: src=r-web.xml.j2 dest={{ smartgears_instance_path }}/webapps/{{ r_connector_name }}/WEB-INF/web.xml mode=0440 notify: Restart smartgears - name: Install the rconnector add users script become_user: root template: src=rusersadd.j2 dest={{ r_connector_adduserscript }} owner=root group=root mode=0555 tags: [ 'smartgears', 'r_connector', 'r_connector_conf', 'tomcat' ] - name: Install the script that unmounts the remote workspace become_user: root template: src=rconnector_unmount dest={{ r_connector_workspace_unmount }} owner=root group=root mode=0555 tags: [ 'smartgears', 'r_connector', 'r_connector_conf', 'tomcat' ] - name: Install the script that checks for stale workspace mounts become_user: root template: src=rconnector_check_stale_sessions dest={{ r_connector_check_stale_sessions }} owner=root group=root mode=0555 tags: [ 'smartgears', 'r_connector', 'r_connector_conf', 'tomcat' ] - name: Install the cron job that regulary wipes out the stale workspace mounts become_user: root cron: name="Unmount the stale workspace sessions" special_time=hourly job="{{ r_connector_check_stale_sessions }} >/dev/null 2>&1" user=root tags: [ 'smartgears', 'r_connector', 'r_connector_conf', 'tomcat' ] - name: Crete the directory that will host the RConfiguration stuff become_user: root file: dest={{ r_connector_rprofile_base_dir }} owner={{ d4science_user }} group={{ d4science_user }} state=directory - name: Download the fuse jar-with-dependencies become_user: root maven_artifact: artifact_id={{ fuse_integration_name }} version={{ fuse_integration_version }} group_id={{ fuse_integration_group_id }} extension={{ fuse_integration_extension }} repository_url={{ smartgears_global_base_url }} classifier={{ fuse_integration_classifier }} dest=/usr/local/lib/{{ fuse_integration_file }} - name: Get the svn repository that provides the .Rprofile subversion: repo={{ r_connector_rprofile_svn_url }} dest={{ r_connector_rprofile_path }} - name: Install /etc/R/Rprofile.site as a symlink to the svn repository become_user: root file: src={{ r_connector_rprofile_path }}/.Rprofile dest=/etc/R/Rprofile.site state=link force=yes tags: [ 'smartgears', 'r_connector', 'r_connector_conf', 'tomcat' ] - name: Install the cron job that regulary updates the Rprofile cron: name="Update the RStudioConfiguration repo" special_time=daily job="cd {{ r_connector_rprofile_path }} ; svn update >/dev/null 2>&1" become: True become_user: '{{ smartgears_user }}' when: r_connector_install tags: [ 'smartgears', 'r_connector', 'tomcat' ] - block: # Additional fuse packages - name: Install the fuse required packages apt: pkg={{ r_connector_fuse_packages }} state=present update_cache=yes cache_valid_time=3600 when: r_connector_install tags: [ 'smartgears', 'r_connector', 'tomcat' ] - block: - name: Reconfigure the Java environment for R shell: export JAVA_HOME={{ jdk_java_home }} ; export J2SDKDIR={{ jdk_java_home }} ; export J2REDIR={{ jdk_java_home }}/jre ; R CMD javareconf when: jdk_java_home is defined become: True become_user: root when: r_connector_install tags: [ 'smartgears', 'r_connector', 'tomcat' ] - block: - name: Install the packages required to enable the LDAP PAM authentication apt: pkg={{ item }} state=present update_cache=yes cache_valid_time=1800 with_items: '{{ r_connector_deb_pkgs }}' - name: Install the pam ldap configuration. We cannot use the debian tools, they are broken on ubuntu in non interactive mode copy: src={{ item }} dest=/etc/pam.d/{{ item }} with_items: '{{ r_connector_ldap_map_common }}' notify: - Restart the NSLCD service - Restart the NSCD service - name: Create the ldap-auth-config directory file: dest=/etc/auth-client-config/profile.d state=directory notify: - Restart the NSLCD service - Restart the NSCD service - name: Install the ldap-auth-config file copy: src=ldap-auth-config dest=/etc/auth-client-config/profile.d/ldap-auth-config notify: - Restart the NSLCD service - Restart the NSCD service - name: Install the nsswitch.conf file copy: src=nsswitch.conf dest=/etc/nsswitch.conf notify: - Restart the NSLCD service - Restart the NSCD service - name: Install the nslcd configuration template: src=nslcd.conf.j2 dest=/etc/nslcd.conf mode=0640 owner=root group=nslcd notify: - Restart the NSLCD service - Restart the NSCD service tags: [ 'smartgears', 'r_connector', 'tomcat', 'r_connector_nslcd_conf' ] - name: Install a script that checks if the ldap authentication is working, and if not it restarts the ns(l)cd daemons copy: src=check_ldap_users dest=/usr/local/bin/check_ldap_users owner=root group=root mode=0555 tags: [ 'smartgears', 'r_connector', 'tomcat', 'r_connector_check_ldap' ] - name: Add a cron job that runs the ldap users check script cron: name="check ldap users" job="/usr/local/bin/check_ldap_users" state=present user=root tags: [ 'smartgears', 'r_connector', 'tomcat', 'r_connector_check_ldap' ] when: - r_connector_install - r_connector_ldap_enabled tags: [ 'smartgears', 'r_connector', 'tomcat' ]