Add missing files & finish TODO's
This commit is contained in:
parent
27a88a719f
commit
3918c63751
6 changed files with 58 additions and 6 deletions
|
|
@ -1,6 +1,8 @@
|
|||
app_url: "https://git.fudiggity.nl/sonny/transip_client.git"
|
||||
app_branch: "0.2"
|
||||
app_dir: "{{ ansible_env.HOME }}/apps/transip_client"
|
||||
app_domains:
|
||||
- fudiggity.nl
|
||||
|
||||
app_token: !vault |
|
||||
$ANSIBLE_VAULT;1.1;AES256
|
||||
|
|
@ -41,10 +43,18 @@ app_token: !vault |
|
|||
35663964633839353136643666653738343431353461623033643033666234343233333131316534
|
||||
33353665303363373734303165363438373431336365636530633163303730393830393464633466
|
||||
6239
|
||||
app_domains:
|
||||
- fudiggity.nl
|
||||
|
||||
systemd_dir: "{{ ansible_user_id }}/.config/systemd/user"
|
||||
|
||||
sentry_dsn: !vault |
|
||||
$ANSIBLE_VAULT;1.1;AES256
|
||||
61373236373662333134383264616666666433363766666166633730306332613138386339626561
|
||||
3765636535666163363066313238353832336334623361630a306539646639383233323236646462
|
||||
62306161396438386639383262343962366366376137336634663564343132656364393461336432
|
||||
3766396162386463610a643836306232373262306532663337303331373338393833376364666633
|
||||
30373037643266623165353439373661333734303466616462353464396233613165643034393664
|
||||
35393536636238653338393163373966356636653362343039366230636364363233376336383331
|
||||
636663383661346534613533653133376534
|
||||
|
||||
packages: []
|
||||
skip_common_setup: true
|
||||
|
|
|
|||
7
roles/transip_client/handlers/main.yml
Normal file
7
roles/transip_client/handlers/main.yml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
- name: enable transip-client timer
|
||||
systemd:
|
||||
daemon-reload: yes
|
||||
name: transip-client.timer
|
||||
state: restarted
|
||||
enabled: true
|
||||
scope: user
|
||||
|
|
@ -57,18 +57,23 @@
|
|||
environment:
|
||||
PATH: "/home/{{ app_user }}/.local/bin:{{ poetry_user_path }}"
|
||||
|
||||
# TODO add service/timer
|
||||
- name: copy environment file
|
||||
template:
|
||||
src: "env.j2"
|
||||
dest: "{{ app_dir }}/.env"
|
||||
mode: 0600
|
||||
|
||||
- name: copy systemd templates
|
||||
template:
|
||||
loop:
|
||||
- {
|
||||
src: "timer.j2",
|
||||
dest: "{{ systemd_dir }}/transip_client.timer",
|
||||
dest: "{{ systemd_dir }}/transip-client.timer",
|
||||
mode: "0644",
|
||||
}
|
||||
- {
|
||||
src: "service.j2",
|
||||
dest: "{{ systemd_dir }}/transip_client.service",
|
||||
dest: "{{ systemd_dir }}/transip-client.service",
|
||||
mode: "0644",
|
||||
}
|
||||
notify: enable transip_client timer
|
||||
notify: enable transip-client timer
|
||||
|
|
|
|||
3
roles/transip_client/templates/env.j2
Normal file
3
roles/transip_client/templates/env.j2
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
DOMAINS="{{ app_domains | join(':') }}"
|
||||
TOKEN="{{ app_token }}"
|
||||
SENTRY_DSN="{{ sentry_dsn }}"
|
||||
14
roles/transip_client/templates/service.j2
Normal file
14
roles/transip_client/templates/service.j2
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
# {{ ansible_managed }} {{ ansible_date_time.time }} {{ ansible_date_time.date }}
|
||||
#
|
||||
|
||||
[Unit]
|
||||
Description=Transip-client service
|
||||
|
||||
[Service]
|
||||
EnvironmentFile={{ app_dir }}/.env
|
||||
WorkingDirectory={{ app_dir }}
|
||||
ExecStart=poetry run listen
|
||||
Type=oneshot
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
13
roles/transip_client/templates/timer.j2
Normal file
13
roles/transip_client/templates/timer.j2
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
# {{ ansible_managed }} {{ ansible_date_time.time }} {{ ansible_date_time.date }}
|
||||
#
|
||||
|
||||
[Unit]
|
||||
Description=Trans IP client timer
|
||||
|
||||
[Timer]
|
||||
OnCalendar=+5min
|
||||
Unit=transip-client.service
|
||||
Persistent=true
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
Reference in a new issue