-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaybook.yaml
More file actions
executable file
·88 lines (73 loc) · 2.54 KB
/
playbook.yaml
File metadata and controls
executable file
·88 lines (73 loc) · 2.54 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
---
- import_playbook: basic-setup.yaml
- hosts: sdr-station
tasks:
- name: Update apt cache
apt:
update_cache: yes
- name: Upgrade all packages
apt:
upgrade: dist
- name: Check if reboot is required
stat:
path: /var/run/reboot-required
register: reboot_required
- name: Reboot if required
reboot:
reboot_timeout: 600
when: reboot_required.stat.exists
- name: Import rtl-sdr installation tasks
import_tasks: rtl-sdr-install.yaml
- name: Create user sdr-system if not exists
user:
name: sdr-system
state: present
- name: Get latest release info from GitHub API
uri:
url: https://api.github.com/repos/AlexandreRouma/SDRPlusPlus/releases/latest
return_content: yes
register: release_info
- name: Extract checksum from release assets
set_fact:
sdrpp_checksum: "{{ (release_info.content | from_json).assets | selectattr('name', 'equalto', 'sdrpp_debian_trixie_aarch64.deb') | map(attribute='digest') | first | regex_replace('^sha256:', '') }}"
- name: Check if SDR++ deb exists and get its checksum
stat:
path: /home/sdr-system/sdrpp_debian_trixie_aarch64.deb
checksum_algorithm: sha256
register: deb_stat
- name: Download SDR++ deb package
get_url:
url: https://github.com/AlexandreRouma/SDRPlusPlus/releases/download/nightly/sdrpp_debian_trixie_aarch64.deb
dest: /home/sdr-system/sdrpp_debian_trixie_aarch64.deb
owner: sdr-system
group: sdr-system
mode: '0644'
checksum: sha256:{{ sdrpp_checksum }}
become: yes
when: not deb_stat.stat.exists or deb_stat.stat.checksum != sdrpp_checksum
- name: Install SDR++ deb package
apt:
deb: /home/sdr-system/sdrpp_debian_trixie_aarch64.deb
become: yes
- name: Create systemd service file for SDR++ server
copy:
dest: /etc/systemd/system/sdrpp-server.service
content: |
[Unit]
Description=SDR++ Server
After=network.target
[Service]
Type=simple
User=root
ExecStart=/usr/bin/sdrpp --server
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
become: yes
- name: Enable and start SDR++ server service
systemd:
name: sdrpp-server
enabled: yes
state: started
become: yes