-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* initial twitcher support
- Loading branch information
Showing
23 changed files
with
391 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
server_name: 192.168.128.100 | ||
service_enable_https: true | ||
db_install_postgresql: true | ||
db_install_sqlite: false | ||
wps_enable_https: false | ||
# Enable separate Fileserver for WPS outputs | ||
# fs_enabled: false | ||
# fs_host: "{{ server_name }}" | ||
# fs_port: 5001 | ||
# Conda spec | ||
# conda_env_use_spec: false | ||
# Configuration for Emu WPS | ||
wps_services: | ||
- name: emu | ||
hostname: "{{ server_name }}" | ||
fs_hostname: "{{ server_name }}" | ||
port: 5000 | ||
extra_config: | | ||
[data] | ||
cache_path = /tmp/cache | ||
# twitcher | ||
twitcher_enabled: true | ||
twitcher_enable_https: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ | |
mode: 0440 | ||
tags: | ||
nginx | ||
when: wps_enable_https | ||
when: service_enable_https |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
- name: restart twitcher | ||
supervisorctl: | ||
name: "twitcher" | ||
state: restarted | ||
# config: "{{ supervisor_config_path}}/supervisord.conf" | ||
username: "{{ supervisor_user }}" | ||
password: "{{ supervisor_password }}" | ||
|
||
- name: restart nginx | ||
service: | ||
name: nginx | ||
state: restarted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
- name: Create Conda environment from environment file. | ||
command: "{{ conda_bin }} env update -p {{ conda_envs_dir}}/twitcher" | ||
args: | ||
chdir: "{{ src_dir }}/twitcher" | ||
register: conda_env_twitcher | ||
tags: | ||
- twitcher | ||
- conda | ||
|
||
- name: Install additional Conda packages. | ||
command: "{{ conda_bin }} install -y -p {{ conda_envs_dir}}/twitcher gunicorn psycopg2" | ||
when: conda_env_twitcher.changed | ||
tags: | ||
- twitcher | ||
- conda | ||
|
||
- name: Install twitcher with pip | ||
command: "{{ conda_envs_dir }}/twitcher/bin/pip install -e {{ src_dir }}/twitcher" | ||
register: conda | ||
tags: | ||
- twitcher | ||
- conda |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
- name: Copy twitcher config | ||
template: | ||
src: ./templates/twitcher.ini.j2 | ||
dest: "{{ twitcher_ini }}" | ||
tags: | ||
- twitcher | ||
- conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
- name: Migrate database. | ||
command: "{{ conda_envs_dir }}/twitcher/bin/alembic -c {{ twitcher_ini }} upgrade head" | ||
args: | ||
chdir: "{{ src_dir }}/twitcher" | ||
register: twitcher_db | ||
tags: | ||
- twitcher |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
- name: Create folders used by twitcher and set owner | ||
file: path={{ item }} state=directory owner={{ twitcher_user }} group={{ twitcher_group }} mode=0755 | ||
with_items: | ||
- /var/lib/twitcher | ||
- /var/run | ||
tags: | ||
- twitcher | ||
- conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
- include: source.yml | ||
when: twitcher_enabled | ||
|
||
- include: conda.yml | ||
when: twitcher_enabled | ||
|
||
- include: folders.yml | ||
when: twitcher_enabled | ||
|
||
- include: config.yml | ||
when: twitcher_enabled | ||
|
||
- include: db.yml | ||
when: twitcher_enabled | ||
|
||
- include: sqlite.yml | ||
when: twitcher_enabled and db_install_sqlite | ||
|
||
- include: supervisor.yml | ||
when: twitcher_enabled | ||
|
||
- include: nginx.yml | ||
when: twitcher_enabled | ||
|
||
- name: Assure Twitcher running at end of playbook | ||
command: /bin/true | ||
notify: | ||
- restart twitcher | ||
tags: | ||
- twitcher | ||
- conda | ||
- conf | ||
when: twitcher_enabled | ||
|
||
- name: Assure nginx running at end of playbook | ||
command: /bin/true | ||
notify: | ||
- restart nginx | ||
tags: | ||
- nginx | ||
- conf | ||
when: twitcher_enabled |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
- name: Copy nginx config to remote | ||
template: | ||
src: ./templates/nginx.conf.j2 | ||
dest: "{{ nginx_conf_path }}/twitcher.conf" | ||
tags: | ||
- twitcher | ||
- conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
- name: Clone Twitcher. | ||
git: | ||
repo: "https://github.com/bird-house/twitcher" | ||
version: "{{ twitcher_version }}" | ||
dest: "{{ src_dir }}/twitcher" | ||
update: yes | ||
force: yes | ||
register: git | ||
tags: | ||
- twitcher | ||
- git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
- name: Update sqlite db file permissions | ||
file: path="/var/lib/twitcher/twitcher.sqlite" state=touch owner={{ twitcher_user }} group={{ twitcher_group }} mode=0644 | ||
tags: | ||
- twitcher | ||
- conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
- name: Copy supervisord job file | ||
template: | ||
src: ./templates/supervisor.conf.j2 | ||
dest: "{{ supervisor_config_path }}/conf.d/twitcher.conf" | ||
owner: root | ||
tags: | ||
- twitcher | ||
- conf |
Oops, something went wrong.