more stuff on scanner.busnet

This commit is contained in:
Craig McDaniel
2025-10-04 20:23:59 -05:00
parent 9fbc496fa2
commit 2bd3d99e0f
8 changed files with 342 additions and 66 deletions

View File

@@ -1,16 +0,0 @@
# scanner.busnet
#
---
- name: Install and Configure Direwolf on scanner.busnet
hosts: scanner.busnet
become: true
gather_facts: true
tasks:
#- name: Hamlib
# ansible.builtin.import_role:
# name: hamlib
- name: Direwolf
ansible.builtin.import_role:
name: scanner_direwolf

View File

@@ -0,0 +1,23 @@
# scanner.busnet
#
---
- name: Install and Configure Direwolf on scanner.busnet
hosts: scanner.busnet
become: true
gather_facts: true
tasks:
- name: Hamlib
ansible.builtin.import_role:
name: hamlib
when: run_hamlib is defined and run_hamlib | bool
- name: Direwolf
ansible.builtin.import_role:
name: scanner_direwolf
when: run_direwolf is defined and run_direwolf | bool
- name: Pat
ansible.builtin.import_role:
name: scanner_pat
when: run_pat is defined and run_pat | bool

View File

@@ -1,10 +1,29 @@
# Role: scanner_direwolf
#
# This installs and configures direwolf on the scanner.bus computer
# - Set up udev rules
# - Set up systemd services
# - Actually down, compile and install direwolf program
#
# - Set up udev rules to make special device drivers for the Yaesu 991 in /dev/radio so we don't
# have to relay on /dev/ttyUSB0, 1 or whatever number the OS happens to assign. This gives the
# device names consistency.
#
# - Set up systemd service to start Direwolf when the radio is connected via USB, and to stop it
# when the radio is disconnected.
#
# - Download, compile and install direwolf from source.
#
# - Copy configuration files
#
- name: Create various directories
file:
path: "{{item}}"
state: directory
owner: busnet
group: busnet
mode: u=rwx,g=rwx,o=rx
with_items:
- /opt/busnet/direwolf
- /opt/busnet/direwolf/config
- /opt/busnet/direwolf/logs
- name: Make sure busnet user is in groups for audio and USB access
ansible.builtin.user:
@@ -40,44 +59,7 @@
when: ft991a_udev_result.changed
###################################################################################################
# SYSTEMD
###################################################################################################
- name: Install systemd unit file for Yaesu FT-991a
template:
src: "templates/ft991a-direwolf.service.j2"
dest: "/etc/systemd/system/ft991a-direwolf.service"
owner: root
group: root
mode: "0644"
- name: Enable ft991a-direwolf service
systemd:
name: "ft991a-direwolf"
daemon_reload: true
enabled: true
- name: Create various directories
file:
path: "{{item}}"
state: directory
owner: busnet
group: busnet
mode: u=rwx,g=rwx,o=rx
with_items:
- /opt/busnet/direwolf
- /opt/busnet/direwolf/config
- /opt/busnet/direwolf/logs
- name: Copy Direwolf config for Yaesu FT-991a
template:
src: "templates/ft991a-direwolf.conf.j2"
dest: "/opt/busnet/direwolf/config/ft991a.conf"
owner: busnet
group: busnet
###################################################################################################
# Compile and install Difewolf
# Compile and install Direwolf from source
###################################################################################################
- name: Install correct prerequite packages when running Ubuntu Noble
@@ -115,11 +97,27 @@
chdir: /opt/busnet/direwolf/source/build
target: install
#- name: Install/Update various software in the standard repos
# apt:
# name: "{{ packages }}"
# state: latest
# vars:
# packages:
# - direwolf
- name: Copy Direwolf config for Yaesu FT-991a
template:
src: "templates/ft991a-direwolf.conf.j2"
dest: "/opt/busnet/direwolf/config/ft991a.conf"
owner: busnet
group: busnet
###################################################################################################
# SYSTEMD
###################################################################################################
- name: Install systemd unit file for Yaesu FT-991a
template:
src: "templates/ft991a-direwolf.service.j2"
dest: "/etc/systemd/system/ft991a-direwolf.service"
owner: root
group: root
mode: "0644"
- name: Enable ft991a-direwolf service
systemd:
name: "ft991a-direwolf"
daemon_reload: true
enabled: true

View File

@@ -0,0 +1,84 @@
{
"mycall": "K0BIT",
"secure_login_password": "RYMF4H",
"auxiliary_addresses": [],
"locator": "EL49XW",
"auto_download_size_limit": -1,
"service_codes": [
"PUBLIC"
],
"http_addr": "[::]:8080",
"motd": [
"BusNet Pat Winlink Client for K0BIT"
],
"connect_aliases": {
"telnet": "telnet://{mycall}:CMSTelnet@cms.winlink.org:8772/wl2k"
},
"listen": [],
"hamlib_rigs": {},
"ax25": {
"engine": "linux",
"rig": "",
"beacon": {
"every": 0,
"message": "",
"destination": ""
}
},
"ax25_linux": {
"port": "wl2k"
},
"agwpe": {
"name: "Yaesu FT-991a",
"addr": "scanner.busnet:8011",
"radio_port": 0
},
"serial-tnc": {
"path": "",
"serial_baud": 9600,
"hbaud": 1200,
"type": "",
"rig": ""
},
"ardop": {
"addr": "",
"arq_bandwidth": {
"Forced": false,
"Max": 200
},
"rig": "",
"ptt_ctrl": false,
"beacon_interval": 0,
"cwid_enabled": false
},
"pactor": {
"path": "/dev/ttyUSB0",
"baudrate": 57600,
"rig": "",
"custom_init_script": ""
},
"telnet": {
"listen_addr": ":8774",
"password": ""
},
"varahf": {
"addr": "localhost:8300",
"bandwidth": 2300,
"rig": "",
"ptt_ctrl": false
},
"varafm": {
"addr": "localhost:8300",
"bandwidth": 0,
"rig": "",
"ptt_ctrl": false
},
"gpsd": {
"enable_http": false,
"allow_forms": false,
"use_server_time": false,
"addr": "localhost:2947"
},
"schedule": {},
"version_reporting_disabled": false
}

View File

@@ -0,0 +1,53 @@
# Role: scanner_pat
# This installs and configures pat winlink client on the scanner.bus computer
#
- name: Create various directories
file:
path: "{{item}}"
state: directory
owner: busnet
group: busnet
mode: u=rwx,g=rwx,o=rx
with_items:
- /opt/busnet/pat
- /opt/busnet/pat/config
- /opt/busnet/pat/forms
- /opt/busnet/pat/logs
- /opt/busnet/pat/mbox
- /opt/busnet/pat/packages
- /opt/busnet/pat/prehooks
###################################################################################################
# Install pat from .deb release files
###################################################################################################
- name: Install pat .deb package direct from github repo
ansible.builtin.apt:
deb: https://github.com/la5nta/pat/releases/download/v0.19.1/pat_0.19.1_linux_arm64.deb
- name: Copy Pat config file
template:
src: "templates/config.json.j2"
dest: "/opt/busnet/pat/config/config.json"
owner: busnet
group: busnet
###################################################################################################
# SYSTEMD
###################################################################################################
- name: Install systemd unit file for Pat
template:
src: "templates/pat.service.j2"
dest: "/etc/systemd/system/pat.service"
owner: root
group: root
mode: "0644"
- name: Enable pat service
systemd:
name: "pat"
daemon_reload: true
enabled: true

View File

@@ -0,0 +1,84 @@
{
"mycall": "K0BIT",
"secure_login_password": "RYMF4H",
"auxiliary_addresses": [],
"locator": "EL49XW",
"auto_download_size_limit": -1,
"service_codes": [
"PUBLIC"
],
"http_addr": "[::]:8080",
"motd": [
"BusNet Pat Winlink Client"
],
"connect_aliases": {
"telnet": "telnet://{mycall}:CMSTelnet@cms.winlink.org:8772/wl2k"
},
"listen": [],
"hamlib_rigs": {},
"ax25": {
"engine": "linux",
"rig": "",
"beacon": {
"every": 0,
"message": "",
"destination": ""
}
},
"ax25_linux": {
"port": "wl2k"
},
"agwpe": {
"name": "hehehe",
"addr": "scanner.busnet:8011",
"radio_port": 0
},
"serial-tnc": {
"path": "",
"serial_baud": 9600,
"hbaud": 1200,
"type": "",
"rig": ""
},
"ardop": {
"addr": "",
"arq_bandwidth": {
"Forced": false,
"Max": 200
},
"rig": "",
"ptt_ctrl": false,
"beacon_interval": 0,
"cwid_enabled": false
},
"pactor": {
"path": "/dev/ttyUSB0",
"baudrate": 57600,
"rig": "",
"custom_init_script": ""
},
"telnet": {
"listen_addr": ":8774",
"password": ""
},
"varahf": {
"addr": "localhost:8300",
"bandwidth": 2300,
"rig": "",
"ptt_ctrl": false
},
"varafm": {
"addr": "localhost:8300",
"bandwidth": 0,
"rig": "",
"ptt_ctrl": false
},
"gpsd": {
"enable_http": false,
"allow_forms": false,
"use_server_time": false,
"addr": "localhost:2947"
},
"schedule": {},
"version_reporting_disabled": false
}

View File

@@ -0,0 +1,13 @@
[Unit]
Description=BusNet Pat Winlink Client
Documentation=https://github.com/la5nta/pat/wiki
After=ax25.service network.target
[Service]
User=busnet
Group=busnet
ExecStart=/usr/bin/pat --config /opt/busnet/pat/config/config.json --event-log /opt/busnet/pat/logs/eventlog.json --log /opt/busnet/pat/logs/pat.log --forms /opt/busnet/pat/forms --mbox /opt/busnet/pat/mbox --prehooks /opt/busnet/pat/prehooks http
Restart=on-failure
[Install]
WantedBy=multi-user.target

View File

@@ -31,6 +31,8 @@ show_help()
echo "scanner.busnet:"
echo "---------------------------------------------------------------------------------------------------------------"
echo " --scanner-direwolf Install and configure direwolf on scanner.busnet"
echo " --scanner-pat Install and configure pat winlink client on scanner.busnet"
echo " --scanner-hamlib Install and configure direwolf on scanner.busnet"
echo
}
@@ -51,6 +53,12 @@ main()
elif [ "${COMMAND}" = "--scanner-direwolf" ]; then
scanner_direwolf
elif [ "${COMMAND}" = "--scanner-hamlib" ]; then
scanner_hamlib
elif [ "${COMMAND}" = "--scanner-pat" ]; then
scanner_pat
# Show Help
else
show_help
@@ -107,7 +115,36 @@ ansible_bootstrap_server()
scanner_direwolf()
{
ansible_playbook playbooks/scanner/direwolf.yml
ansible_playbook playbooks/scanner/scanner.yml run_direwolf=1
if [ $? != 0 ]; then
echo
echo "Ansible playbook execution failed."
echo
else
echo
echo "Ansible playbook execution complete."
echo
fi
}
scanner_hamlib()
{
ansible_playbook playbooks/scanner/scanner.yml run_hamlib=1
if [ $? != 0 ]; then
echo
echo "Ansible playbook execution failed."
echo
else
echo
echo "Ansible playbook execution complete."
echo
fi
}
scanner_pat()
{
ansible_playbook playbooks/scanner/scanner.yml run_pat=1
if [ $? != 0 ]; then
echo
echo "Ansible playbook execution failed."