This Ansible project is designed to automate the setup and configuration of Kismet on Raspberry Pi devices, including the installation and configuration of required packages, the creation of necessary scripts, and the configuration of GPS for cell hat and external puck Pis. Additionally, it includes tasks to archive Kismet data, fetch it, and delete the data folder contents after fetching.
- Purge old Kismet packages
- Update and upgrade packages
- Install required packages
- Import Kismet GPG key
- Add Kismet repository
- Update apt cache and install Kismet
- Clone python-kismet-metagpsd repository
- Install requirements from python-kismet-metagpsd
- Create enable_gps.py script
- Create multi-source.sh script
- Add enable_gps.py script to crontab
- Configure gpsd for cell_hat Pis
- Configure gpsd for external puck
- Add Kismet capture scripts to crontab
- Modify kismet.conf
- Create kismet directory and set permissions
- Modify kismet_logging.conf
- Update log_types in kismet_logging.conf
- Create, enable, and start metagpsd service
- Reboot Raspberry Pi devices
- Check cgps output for latitude and longitude
- Archive Kismet data and fetch it
[cell_hat_pis]
krpi02 ansible_host=192.168.191.233 sensor_name=Node-02
krpi05 ansible_host=192.168.191.102 sensor_name=Node-05
[external_puck_pis]
krpi01 ansible_host=192.168.191.96 sensor_name=Node-01
krpi03 ansible_host=192.168.191.27 sensor_name=Node-03
krpi04 ansible_host=192.168.191.104 sensor_name=Node-04
[krpi_hosts:children]
cell_hat_pis
external_puck_pis
[krpi_hosts:vars]
kismet_connect=192.168.191.218:3501
metagps_connect=192.168.191.218:2501
api_key=KISMET_API_KEY
kismet_data_path=/home/pi/kismet_data
-
Update the Ansible inventory file with the correct IP addresses and sensor names for your Raspberry Pi devices.
-
Ensure your Ansible control node has SSH access to the Raspberry Pi devices.
-
Run the Ansible playbook:
ansible-playbook krpi_setup.yml
- The inventory file contains the following variables: `kismet_connect`, `metagps_connect`, `api_key`, and `kismet_data_path`. Update these as needed for your environment.
- The inventory file includes two groups of Pis: `cell_hat_pis` and `external_puck_pis`. Update these groups based on your specific hardware setup.