2016-07-21 14:58:46 +02:00
|
|
|
---
|
|
|
|
- block:
|
2017-11-24 16:45:44 +01:00
|
|
|
- name: Remove the installed R connector
|
2016-07-21 14:58:46 +02:00
|
|
|
file: dest={{ item }} state=absent
|
|
|
|
with_items:
|
2017-10-19 19:13:06 +02:00
|
|
|
- '{{ smartgears_instance_path }}/webapps/{{ r_connector_name }}'
|
|
|
|
- '{{ smartgears_instance_path }}/webapps/{{ r_connector_name }}.{{ r_connector_extension }}'
|
2017-11-24 16:59:23 +01:00
|
|
|
notify: Restart smartgears
|
2016-07-21 14:58:46 +02:00
|
|
|
|
2017-10-19 19:13:06 +02:00
|
|
|
- name: Remove the packages required to enable the LDAP PAM authentication
|
|
|
|
become: False
|
|
|
|
apt: pkg={{ item }} state=absent
|
|
|
|
with_items: '{{ r_connector_deb_pkgs }}'
|
|
|
|
|
|
|
|
- name: Remove the connector raddusers script
|
|
|
|
become: False
|
|
|
|
file: dest={{ r_connector_adduserscript }} state=absent
|
|
|
|
|
|
|
|
- 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:
|
2017-03-16 19:21:14 +01:00
|
|
|
- name: Get the R Connector war
|
2017-10-19 19:13:06 +02:00
|
|
|
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 }}
|
|
|
|
register: r_connector_download
|
|
|
|
|
|
|
|
- name: Remove the installed R connector before upgrading
|
2017-11-24 16:56:24 +01:00
|
|
|
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
|
2018-08-09 18:48:09 +02:00
|
|
|
when: r_connector_download is changed
|
2017-03-16 19:21:14 +01:00
|
|
|
|
2016-10-21 18:55:31 +02:00
|
|
|
- name: Create the R connector webapp directory
|
2017-10-19 19:13:06 +02:00
|
|
|
file: dest={{ smartgears_instance_path }}/webapps/{{ r_connector_name }} state=directory
|
2018-08-09 18:48:09 +02:00
|
|
|
when: r_connector_download is changed
|
2017-10-19 19:13:06 +02:00
|
|
|
|
|
|
|
- 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 }}
|
2016-07-21 14:58:46 +02:00
|
|
|
args:
|
2017-03-16 19:21:14 +01:00
|
|
|
creates: '{{ smartgears_instance_path }}/webapps/{{ r_connector_name }}/WEB-INF/web.xml'
|
2017-11-24 16:56:24 +01:00
|
|
|
notify: Restart smartgears
|
2017-03-16 19:21:14 +01:00
|
|
|
|
2016-07-21 14:58:46 +02:00
|
|
|
- name: Obtain the permission to read the Rstudio secure cookie key
|
2017-03-16 20:30:29 +01:00
|
|
|
become_user: root
|
2016-07-21 14:58:46 +02:00
|
|
|
file: dest={{ r_connector_rstudio_cookie_key }} mode=640 group={{ smartgears_user }}
|
|
|
|
|
|
|
|
- name: Install the R connector web.xml template
|
2017-10-19 19:13:06 +02:00
|
|
|
template: src=r-web.xml.j2 dest={{ smartgears_instance_path }}/webapps/{{ r_connector_name }}/WEB-INF/web.xml mode=0440
|
2016-07-21 14:58:46 +02:00
|
|
|
notify: Restart smartgears
|
|
|
|
|
2016-07-21 17:14:13 +02:00
|
|
|
- name: Install the R add users script
|
2017-03-16 20:30:29 +01:00
|
|
|
become_user: root
|
2016-07-21 17:14:13 +02:00
|
|
|
template: src=rusersadd.j2 dest={{ r_connector_adduserscript }} owner=root group=root mode=0555
|
|
|
|
|
2016-10-21 18:55:31 +02:00
|
|
|
- name: Crete the directory that will host the RConfiguration stuff
|
2017-03-16 20:30:29 +01:00
|
|
|
become_user: root
|
2016-10-21 18:55:31 +02:00
|
|
|
file: dest={{ r_connector_rprofile_base_dir }} owner={{ d4science_user }} group={{ d4science_user }} state=directory
|
|
|
|
|
|
|
|
- name: Get the svn repository that provides the .Rprofile
|
|
|
|
subversion: repo={{ r_connector_rprofile_svn_url }} dest={{ r_connector_rprofile_path }}
|
|
|
|
|
|
|
|
- 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"
|
2016-09-09 18:05:13 +02:00
|
|
|
|
2016-07-21 14:58:46 +02:00
|
|
|
become: True
|
|
|
|
become_user: '{{ smartgears_user }}'
|
|
|
|
when: r_connector_install
|
|
|
|
tags: [ 'smartgears', 'r_connector', 'tomcat' ]
|
2016-10-21 18:55:31 +02:00
|
|
|
|
2018-10-03 18:46:43 +02:00
|
|
|
- block:
|
|
|
|
- name: Reconfigure the Java environment for R
|
2018-10-09 11:44:05 +02:00
|
|
|
shell: export JAVA_HOME=/usr/lib/jvm/java-8-oracle ; export J2SDKDIR=/usr/lib/jvm/java-8-oracle ; export J2REDIR=/usr/lib/jvm/java-8-oracle/jre ; R CMD javareconf
|
2018-10-03 18:46:43 +02:00
|
|
|
|
|
|
|
become: True
|
|
|
|
become_user: root
|
|
|
|
when: r_connector_install
|
|
|
|
tags: [ 'smartgears', 'r_connector', 'tomcat' ]
|
|
|
|
|
2017-03-16 19:21:14 +01:00
|
|
|
- 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 }}'
|
2017-03-17 19:47:20 +01:00
|
|
|
notify:
|
|
|
|
- Restart the NSLCD service
|
|
|
|
- Restart the NSCD service
|
2017-03-16 19:21:14 +01:00
|
|
|
|
2017-03-17 13:17:13 +01:00
|
|
|
- name: Create the ldap-auth-config directory
|
|
|
|
file: dest=/etc/auth-client-config/profile.d state=directory
|
2017-03-17 19:47:20 +01:00
|
|
|
notify:
|
|
|
|
- Restart the NSLCD service
|
|
|
|
- Restart the NSCD service
|
2017-03-17 13:17:13 +01:00
|
|
|
|
2017-03-16 19:21:14 +01:00
|
|
|
- name: Install the ldap-auth-config file
|
|
|
|
copy: src=ldap-auth-config dest=/etc/auth-client-config/profile.d/ldap-auth-config
|
2017-03-17 19:47:20 +01:00
|
|
|
notify:
|
|
|
|
- Restart the NSLCD service
|
|
|
|
- Restart the NSCD service
|
2017-03-16 19:21:14 +01:00
|
|
|
|
|
|
|
- name: Install the nsswitch.conf file
|
|
|
|
copy: src=nsswitch.conf dest=/etc/nsswitch.conf
|
2017-03-17 19:47:20 +01:00
|
|
|
notify:
|
|
|
|
- Restart the NSLCD service
|
|
|
|
- Restart the NSCD service
|
2017-03-16 19:21:14 +01:00
|
|
|
|
|
|
|
- name: Install the nslcd configuration
|
|
|
|
template: src=nslcd.conf.j2 dest=/etc/nslcd.conf mode=0640 owner=root group=nslcd
|
2017-03-17 13:17:13 +01:00
|
|
|
notify:
|
|
|
|
- Restart the NSLCD service
|
|
|
|
- Restart the NSCD service
|
2018-03-05 15:10:06 +01:00
|
|
|
tags: [ 'smartgears', 'r_connector', 'tomcat', 'r_connector_nslcd_conf' ]
|
2017-03-16 19:21:14 +01:00
|
|
|
|
2018-11-29 14:50:03 +01:00
|
|
|
- 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' ]
|
|
|
|
|
2017-03-16 19:21:14 +01:00
|
|
|
when:
|
|
|
|
- r_connector_install
|
|
|
|
- r_connector_ldap_enabled
|
|
|
|
tags: [ 'smartgears', 'r_connector', 'tomcat' ]
|