-
Notifications
You must be signed in to change notification settings - Fork 0
/
playbook.yml
63 lines (63 loc) · 1.95 KB
/
playbook.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
- name: Kiosk
hosts: all
vars: { ansible_user_id: suhlig }
pre_tasks:
- name: Program snapshot is up to date
local_action:
module: ansible.builtin.command
cmd: goreleaser --snapshot --clean
args:
chdir: "{{ playbook_dir }}"
become: false
- name: Path to binary is set from artifacts.json
ansible.builtin.set_fact:
binary_path: "{{ item['path'] }}"
when: |
item['goos'] is defined and item['goos'] == 'linux'
and item['goarch'] is defined and item['goarch'] == 'arm'
and item['goarm'] is defined and item['goarm'] == '7'
and item['type'] is defined and item['type'] == 'Binary'
loop: "{{ lookup('file', playbook_dir + '/dist/artifacts.json') | from_json }}"
tags: [ kiosk, goreleaser, binary, path, artifacts ]
tasks:
- name: Config file is present
become: true
copy:
src: kiosk.yml
dest: /etc/kiosk.yml
mode: '0644'
owner: "{{ ansible_user_id }}"
register: config_copied
tags: [ kiosk, yaml, config ]
- name: Service is restarted
systemd:
name: kiosk
state: restarted
when: config_copied.changed
tags: [ kiosk, config, systemd, service ]
roles:
- role: kiosk
become: true
tags: [ kiosk, software ]
- role: suhlig.simple_systemd_service
become: true
vars:
systemd:
target: graphical.target
service_binary: kiosk
program:
name: kiosk
description: Display kiosk
runtime_user: "{{ ansible_user_id }}"
binary: "{{ binary_path }}"
parameters:
- --kiosk
- --verbose
- --interval 10s
- --http-address :8011
- --chrome-flag window-position=800,0
- /etc/kiosk.yml
environment:
DISPLAY: ":0.0"
MQTT_URL: "{{ mqtt_url }}"
tags: [ kiosk, systemd, service ]