Apply fixes

This commit is contained in:
Sonny Bakker 2021-06-05 15:13:46 +02:00
parent 78874bd617
commit 2f50f503e4
4 changed files with 17 additions and 13 deletions

View file

@ -38,12 +38,9 @@
PATH: '/home/{{ app_user }}/.local/bin:{{ poetry_user_path }}' PATH: '/home/{{ app_user }}/.local/bin:{{ poetry_user_path }}'
- name: install project dependencies - name: install project dependencies
command: command: 'poetry install --no-dev'
argv: args:
- 'poetry install' chdir: '{{ app_dir }}'
- '--no-dev'
args:
chdir: '{{ app_dir }}'
environment: environment:
PATH: '/home/{{ app_user }}/.local/bin:{{ poetry_user_path }}' PATH: '/home/{{ app_user }}/.local/bin:{{ poetry_user_path }}'
@ -53,8 +50,16 @@
dest: '{{ app_dir }}/.env' dest: '{{ app_dir }}/.env'
mode: 0600 mode: 0600
- name: create systemd user directory
file:
path: '{{ systemd_dir }}'
state: 'directory'
- name: copy systemd templates - name: copy systemd templates
template: template:
src: '{{ item.src }}'
dest: '{{ item.dest }}'
mode: '{{ item.mode }}'
loop: loop:
- { - {
src: 'templates/timer.j2', src: 'templates/timer.j2',

View file

@ -7,8 +7,5 @@ Description=Transip-client service
[Service] [Service]
EnvironmentFile={{ app_dir }}/.env EnvironmentFile={{ app_dir }}/.env
WorkingDirectory={{ app_dir }} WorkingDirectory={{ app_dir }}
ExecStart=poetry run listen ExecStart={{ ansible_env.HOME }}/.local/bin/poetry run listen
Type=oneshot Type=oneshot
[Install]
WantedBy=default.target

View file

@ -5,7 +5,8 @@
Description=Trans IP client timer Description=Trans IP client timer
[Timer] [Timer]
OnCalendar=+5min OnBootSec=15min
OnUnitActiveSec=5min
Unit=transip-client.service Unit=transip-client.service
Persistent=true Persistent=true

View file

@ -1,4 +1,5 @@
app_url: 'https://git.fudiggity.nl/sonny/transip_client.git' app_url: 'https://git.fudiggity.nl/sonny/transip_client.git'
app_user: 'sonny'
app_branch: '0.3.1' app_branch: '0.3.1'
app_dir: '{{ ansible_env.HOME }}/apps/transip_client' app_dir: '{{ ansible_env.HOME }}/apps/transip_client'
app_domains: app_domains:
@ -44,7 +45,7 @@ app_token: !vault |
61353763326432313934363132353738323437366537383763313361636165353165353566396261 61353763326432313934363132353738323437366537383763313361636165353165353566396261
6237 6237
systemd_dir: '{{ ansible_user_id }}/.config/systemd/user' systemd_dir: '{{ ansible_env.HOME }}/.config/systemd/user'
sentry_dsn: !vault | sentry_dsn: !vault |
$ANSIBLE_VAULT;1.1;AES256 $ANSIBLE_VAULT;1.1;AES256
@ -60,4 +61,4 @@ packages:
- python3 - python3
- python3-dev - python3-dev
- python3-venv - python3-venv
- dns-utils - getdns-utils