Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions ansible/playbooks/30-wegetit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
# Setup the website
- hosts: tachikoma
become: yes
tasks:
- name: Add wegetit user
user:
name: wegetit
- name: Create wegetit application directory
file:
path: /opt/wegetit
state: directory
- name: Create storage directory
file:
path: /var/wegetit
owner: wegetit
group: wegetit
state: directory
mode: 0700
- name: Clone wegetit repo
git:
repo: 'https://github.com/queeriouslabs/wegetit'
dest: /opt/wegetit
- name: Install requirements
pip:
virtualenv_python: python3
venv: /opt/wegetit/venv
requirements: /opt/wegetit/src/requirements.txt
- name: Install wegetit service file
copy:
src: wegetit/wegetit.service
dest: /etc/systemd/system/wegetit.service
mode: 0644
- name: Setup systemd wegetit service
systemd:
name: wegetit.service
state: started
enabled: yes
17 changes: 17 additions & 0 deletions ansible/playbooks/wegetit/wegetit.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[Unit]
Description=WeGetIt Service
After=network.target

[Service]
Type=simple

User=wegetit
Group=wegtit

WorkingDirectory=/opt/wegetit/src

ExecStart=/opt/wegetit/venv/bin/gunicorn 'wegetit:main("/var/wegetit/db.json")'
Restart=none

[Install]
WantedBy=multi-user.target