2016-07-21 14:58:46 +02:00
|
|
|
---
|
|
|
|
- block:
|
|
|
|
- name: Remove the installed R connector before upgrading
|
|
|
|
file: dest={{ item }} state=absent
|
|
|
|
with_items:
|
|
|
|
- '{{ smartgears_instance_path }}/webapps/r-connector'
|
|
|
|
- '{{ smartgears_instance_path }}/webapps/r-connector.war'
|
2016-10-21 18:55:31 +02:00
|
|
|
when: smartgears_upgrade
|
2016-07-21 14:58:46 +02:00
|
|
|
|
2016-10-21 18:55:31 +02:00
|
|
|
- name: Create the R connector webapp directory
|
|
|
|
file: dest={{ smartgears_instance_path }}/webapps/r-connector state=directory
|
|
|
|
|
|
|
|
- name: Get and unpack the R connector war file
|
|
|
|
unarchive: copy=no src={{ r_connector_url }} dest={{ smartgears_instance_path }}/webapps/r-connector
|
2016-07-21 14:58:46 +02:00
|
|
|
args:
|
|
|
|
creates: '{{ smartgears_instance_path }}/webapps/r-connector/WEB-INF/web.xml'
|
2016-10-21 18:55:31 +02:00
|
|
|
|
2016-07-21 14:58:46 +02:00
|
|
|
- name: Obtain the permission to read the Rstudio secure cookie key
|
2016-07-21 17:14:13 +02:00
|
|
|
become: False
|
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
|
|
|
|
template: src=r-web.xml.j2 dest={{ smartgears_instance_path }}/webapps/r-connector/WEB-INF/web.xml mode=0440
|
|
|
|
notify: Restart smartgears
|
|
|
|
|
2016-10-21 18:55:31 +02:00
|
|
|
- name: Install the packages required to enable the LDAP PAM authentication
|
2016-10-27 16:04:24 +02:00
|
|
|
become: False
|
2016-10-21 18:55:31 +02:00
|
|
|
apt: pkg={{ item }} state=present update_cache=yes cache_valid_time=1800
|
|
|
|
with_items: '{{ r_connector_deb_pkgs }}'
|
|
|
|
|
2016-07-21 17:14:13 +02:00
|
|
|
- name: Install the R add users script
|
|
|
|
become: False
|
|
|
|
template: src=rusersadd.j2 dest={{ r_connector_adduserscript }} owner=root group=root mode=0555
|
2016-10-21 18:55:31 +02:00
|
|
|
tags: [ 'smartgears', 'r_connector', 'tomcat', 'rusersadd' ]
|
2016-07-21 17:14:13 +02:00
|
|
|
|
2016-10-21 18:55:31 +02:00
|
|
|
- name: Crete the directory that will host the RConfiguration stuff
|
|
|
|
become: False
|
|
|
|
file: dest={{ r_connector_rprofile_base_dir }} owner={{ d4science_user }} group={{ d4science_user }} state=directory
|
|
|
|
tags: [ 'smartgears', 'r_connector', 'tomcat', 'rusersadd' ]
|
|
|
|
|
|
|
|
- name: Get the svn repository that provides the .Rprofile
|
|
|
|
subversion: repo={{ r_connector_rprofile_svn_url }} dest={{ r_connector_rprofile_path }}
|
|
|
|
tags: [ 'smartgears', 'r_connector', 'tomcat', 'rusersadd' ]
|
|
|
|
|
|
|
|
- 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"
|
|
|
|
tags: [ 'smartgears', 'r_connector', 'tomcat', 'rusersadd' ]
|
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
|
|
|
|
|
|
|
- block:
|
|
|
|
- name: Remove the installed R connector before upgrading
|
|
|
|
file: dest={{ item }} state=absent
|
|
|
|
with_items:
|
|
|
|
- '{{ smartgears_instance_path }}/webapps/r-connector'
|
|
|
|
- '{{ smartgears_instance_path }}/webapps/r-connector.war'
|
|
|
|
|
|
|
|
- name: Remove the packages required to enable the LDAP PAM authentication
|
2016-10-27 16:04:24 +02:00
|
|
|
become: False
|
2016-10-21 18:55:31 +02:00
|
|
|
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' ]
|