-
Notifications
You must be signed in to change notification settings - Fork 0
/
rtl_sdr_portable.yml
80 lines (78 loc) · 2.09 KB
/
rtl_sdr_portable.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
69
70
71
72
73
74
75
76
77
78
---
#####
#The idea is from the page
#http://fuzzthepiguy.tech/rtlsdr/
######
- hosts: all
become: yes
vars:
git_clone_dir: /tmp/rtl-sdr-git-repo
build_directory: /tmp/rtl-sdr-git-repo/build
tasks:
- name: Upgrade the OS before start
apt:
upgrade: safe
update_cache: yes
- name: Install packages git cmake pkg-config libusb-1.0-0-dev
apt:
pkg:
- git
- cmake
- pkg-config
- libusb-1.0-0-dev
- name: Download GIT repo from osmocom
git:
repo: git://git.osmocom.org/rtl-sdr.git
dest: "{{ git_clone_dir }}"
- name: Create a directory build
file:
path: "{{ build_directory }}"
state: directory
mode: '0755'
- name: Change the working to /tmp/rtl-sdr-git-repo and run cmake
shell: cmake ../ -DINSTALL_UDEV_RULES=ON
args:
chdir: "{{ build_directory }}"
- name: Build - make -j4
make:
chdir: "{{ build_directory }}"
params:
NUM_THREADS: 4
- name: Run 'install' target as root
make:
chdir: "{{ build_directory }}"
target: install
become: yes
#sudo cp ../rtl-sdr.rules /etc/udev/rules.d/
- name: copy {{ git_clone_dir }}/debian/librtlsdr0.udev to /etc/udev/rules.d/
copy:
src: "{{ git_clone_dir }}/debian/librtlsdr0.udev"
dest: /etc/udev/rules.d/rtl-sdr.rules
remote_src: yes
become: yes
- name: ldconfig
shell: ldconfig
become: yes
- name: Blacklist modules
kernel_blacklist:
name: "{{ item }}"
state: present
with_items:
- dvb_usb_rtl28xxu
- rtl2832
- rtl2830
tags: conf_blacklist
- name: create systemd unit for rtlsdr.service
template:
src: files/rtlsdr.service
dest: /etc/systemd/system/rtlsdr.service
owner: root
group: root
mode: 0644
tags: conf_systemd
- name: enable a rtlsdr systemd unit and start
systemd:
name: rtlsdr.service
state: started
enabled: yes
tags: conf_systemd