[ADD] scanner-start и scanner-stop: peleng на всех узлах одной командой

This commit is contained in:
Arseny
2026-10-03 18:27:34 +03:00
parent bd4443d5f1
commit 401ef2c101
5 changed files with 83 additions and 16 deletions
+5 -7
View File
@@ -4,8 +4,6 @@
- name: Код hackrf-scanner на узлы и сборка
hosts: all
gather_facts: false
vars:
scanner_dest: /home/pi/hackrf-scanner
tasks:
- name: Ревизия исходников на управляющей машине
delegate_to: localhost
@@ -17,7 +15,7 @@
- name: Исходники на узле (без .git и build), лишние файлы удаляются
ansible.posix.synchronize:
src: "{{ scanner_src }}/"
dest: "{{ scanner_dest }}/"
dest: "{{ scanner_dir }}/"
delete: true
rsync_opts:
- "--exclude=.git"
@@ -28,13 +26,13 @@
- name: След клона прежнего провижнинга не нужен
ansible.builtin.file:
path: "{{ scanner_dest }}/.git"
path: "{{ scanner_dir }}/.git"
state: absent
- name: Метка ревизии
ansible.builtin.copy:
content: "{{ rev.stdout }}\n"
dest: "{{ scanner_dest }}/DEPLOYED"
dest: "{{ scanner_dir }}/DEPLOYED"
mode: "0644"
- name: Сборка
@@ -42,13 +40,13 @@
cmake -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo >/dev/null
cmake --build build -j"$(nproc)"
args:
chdir: "{{ scanner_dest }}"
chdir: "{{ scanner_dir }}"
register: build
changed_when: "'Building CXX' in build.stdout or 'Linking' in build.stdout"
- name: Бинарники на месте
ansible.builtin.stat:
path: "{{ scanner_dest }}/build/{{ item }}"
path: "{{ scanner_dir }}/build/{{ item }}"
register: bins
failed_when: not bins.stat.exists
loop: [peleng, scan]