92 lines
3.5 KiB
YAML
92 lines
3.5 KiB
YAML
---
|
|
- block:
|
|
- name: Create the shinyproxy user
|
|
user: name={{ shinyproxy_user }} home={{ shinyproxy_install_dir }} createhome=yes system=yes shell=/usr/sbin/nologin
|
|
|
|
- name: Download the shinyproxy jar
|
|
become: True
|
|
become_user: '{{ shinyproxy_user }}'
|
|
get_url: url={{ shinyproxy_url }} dest={{ shinyproxy_install_dir }}
|
|
|
|
- name: Set up a symlink to an unversioned app name
|
|
become: True
|
|
become_user: '{{ shinyproxy_user }}'
|
|
file: src={{ shinyproxy_install_dir }}/{{ shinyproxy_file_name }} dest={{ shinyproxy_install_dir }}/{{ shinyproxy_app_name }} state=link
|
|
|
|
- name: Install the shinyproxy configuration file when using version 2.x
|
|
template: src=shinyproxy-2-conf.yml.j2 dest={{ shinyproxy_install_dir }}/application.yml owner=root group={{ shinyproxy_user }} mode=0640
|
|
notify: Restart shinyproxy
|
|
when: shinyproxy_major_ver == 2
|
|
tags: [ 'shinyproxy', 'shinyproxy_conf', 'shinyproxy_images' ]
|
|
|
|
- name: Install the shinyproxy logrotate configuration
|
|
template: src=shinyproxy-logrotate.j2 dest=/etc/logrotate.d/shinyproxy owner=root group=root mode=0444
|
|
tags: [ 'shinyproxy', 'shinyproxy_conf' ]
|
|
|
|
- name: Install the upstart init file
|
|
template: src=upstart-shinyproxy.conf.j2 dest=/etc/init/shinyproxy.conf owner=root group=root mode=0644
|
|
when: ansible_service_mgr != 'systemd'
|
|
|
|
when:
|
|
- ansible_distribution_file_variety == "Debian"
|
|
- ansible_distribution_major_version < '16'
|
|
- shinyproxy_install | bool
|
|
tags: shinyproxy
|
|
|
|
- block:
|
|
- name: Install the shinyproxy deb package
|
|
apt:
|
|
deb: "https://www.shinyproxy.io/downloads/shinyproxy_{{ shinyproxy_version }}_amd64.deb"
|
|
state: present
|
|
|
|
when:
|
|
- ansible_distribution_file_variety == "Debian"
|
|
- ansible_distribution_major_version >= '16'
|
|
- shinyproxy_install | bool
|
|
tags: shinyproxy
|
|
|
|
- block:
|
|
- name: Install the shinyproxy EL package
|
|
yum:
|
|
pkg: "https://www.shinyproxy.io/downloads/shinyproxy_{{ shinyproxy_version }}_x86_64.rpm"
|
|
state: present
|
|
|
|
when:
|
|
- ansible_distribution_file_variety == "RedHat"
|
|
- shinyproxy_install | bool
|
|
tags: shinyproxy
|
|
|
|
- name: Shinyproxy configuration when using the package
|
|
block:
|
|
- name: Install the shinyproxy configuration file when using version 2.x
|
|
template: src=shinyproxy-2-conf.yml.j2 dest=/etc/shinyproxy/application.yml owner=root group={{ shinyproxy_user }} mode=0640
|
|
notify: Restart shinyproxy
|
|
when: shinyproxy_major_ver == 2
|
|
|
|
when:
|
|
- ansible_distribution_major_version >= '16' or ansible_distribution_file_variety == "RedHat"
|
|
- shinyproxy_install | bool
|
|
tags: [ 'shinyproxy', 'shinyproxy_conf', 'shinyproxy_images' ]
|
|
|
|
- block:
|
|
- name: Ensure that the shinyproxy service is enabled and running
|
|
service: name=shinyproxy state=started enabled=yes
|
|
|
|
- name: Create the directory where to install the custom templates, if we want to use them
|
|
file: dest={{ shinyproxy_template_path }} state=directory
|
|
when: shinyproxy_custom_template | bool
|
|
|
|
- name: Create shinyproxy log directory
|
|
file: dest={{ shinyproxy_log_dir }} state=directory owner=shinyproxy mode=0750
|
|
|
|
- name: Pull the Docker images for the Shiny apps, when using Docker standalone
|
|
docker_image: name={{ item.docker_image }} pull=yes state={{ item.image_state | default('present') }} force=yes
|
|
with_items: '{{ shinyproxy_apps }}'
|
|
when:
|
|
- shinyproxy_apps is defined
|
|
- shinyproxy_container_backend == 'docker'
|
|
tags: [ 'shinyproxy', 'shinyproxy_images' ]
|
|
|
|
when: shinyproxy_install | bool
|
|
tags: shinyproxy
|