Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
43 lines (43 sloc) 1.21 KB
---
- hosts: digitalocean
vars:
project_repo: git://github.com/tdhopper/long_running_python_process.git
project_location: /srv/long_running_python_process
program_name: long_running_process
conda_folder_name: miniconda
conda_root: /root
supervisord_configs_path: /etc/supervisor/conf.d
roles:
- role: andrewrothstein.miniconda
miniconda_parent_dir: "{{ conda_root }}"
miniconda_name: "{{ conda_folder_name }}"
tags:
miniconda
- role: supervisor
tasks:
- name: Clone project code.
git:
repo: "{{ project_repo }}"
dest: "{{ project_location }}"
update: yes
tags:
git
- name: Create Conda environment from project environment file.
command: "{{conda_root}}/{{conda_folder_name}}/bin/conda env update"
args:
chdir: "{{ project_location }}"
tags:
conda
- name: Copy supervisord job file to remote
template:
src: ./templates/run_process.j2
dest: "{{ supervisord_configs_path }}/run_process.conf"
owner: root
tags:
conf
- name: Start job
supervisorctl:
name: "{{ program_name }}"
state: present
tags:
conf