-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathraspindi_playbook.yml
68 lines (59 loc) · 2.33 KB
/
raspindi_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
64
65
66
67
68
- name: "raspindi setup"
hosts: localhost
connection: local
sudo: true
tasks:
- name: register raspindi cloned folder
stat:
path: /etc/raspindi
register: raspindi_folder_etc
- name: register raspindi op folder
stat:
path: /opt/raspindi
register: raspindi_folder_opt
- name: register raspindiGUI cloned/op folder
stat:
path: /opt/raspindiGUI
register: raspindiGUI_folder
#--------------------------------------------------------------------------------------------------
- name: clone raspindi
command: chdir=/etc git clone https://github.com/raspberry-pi-camera/raspindi.git
register: git_NDI_ran
when: raspindi_folder_etc.stat.exists == False
- name: updating apt
expect:
command: apt update
responses:
'Do you want to continue\? \[Y/n\]' : Y
when: raspindi_folder_opt.stat.exists == False and git_NDI_ran.changed
- name: installing dependencies
expect:
command: apt install libconfig++-dev libjasper-runtime libavahi-client3
responses:
'Do you want to continue\? \[Y/n\]' : Y
when: raspindi_folder_opt.stat.exists == False and git_NDI_ran.changed
- name: run build script
command: chdir=/etc/raspindi sh ./build.sh
when: raspindi_folder_opt.stat.exists == False and git_NDI_ran.changed
- name: run install script
command: chdir=/etc/raspindi sh ./install.sh
when: raspindi_folder_opt.stat.exists == False and git_NDI_ran.changed
#--------------------------------------------------------------------------------------------------
- name: Enable Camera
shell: "raspi-config nonint do_camera 0"
#--------------------------------------------------------------------------------------------------
#TODO: add correctpaths
- name: clone ndi solution made by Charlie Watson
command: chdir=/opt git clone https://github.com/TIU11/raspindiGUI.git
register: git_GUI_ran
when: raspindiGUI_folder.stat.exists == False
- name: Creating a file with content
copy:
dest: "/etc/xdg/autostart/display.desktop"
content: |
[Desktop Entry]
Name=ndiGUI
Exec=/usr/bin/python3 /opt/raspindiGUI/ndiGUI.py
#--------------------------------------------------------------------------------------------------
- name: reboot pi
shell: reboot