2019-10-02 17:26:29 +01:00
---
- hosts :
2023-09-16 01:44:02 +02:00
- 127.0 .0 .1
gather_facts : true
2023-08-29 14:13:36 +02:00
become : true
2019-10-02 17:26:29 +01:00
vars :
2019-10-05 18:51:20 +02:00
pwnagotchi :
hostname : "{{ lookup('env', 'PWN_HOSTNAME') | default('pwnagotchi', true) }}"
2023-08-24 11:15:12 +02:00
version : "{{ lookup('env', 'PWN_VERSION') | default('pwnagotchi-torch', true) }}"
2019-10-05 18:51:20 +02:00
system :
boot_options :
- "dtoverlay=dwc2"
- "dtoverlay=spi1-3cs"
2019-10-21 16:38:53 +01:00
- "dtparam=spi=on"
- "dtparam=i2c_arm=on"
- "dtparam=i2c1=on"
2019-10-31 08:49:58 +01:00
- "gpu_mem=16"
2019-10-21 16:38:53 +01:00
modules :
- "i2c-dev"
2019-10-05 18:51:20 +02:00
services :
enable :
- dphys-swapfile.service
2019-10-08 13:33:11 +01:00
- pwnagotchi.service
- bettercap.service
2019-10-11 15:12:56 +02:00
- pwngrid-peer.service
2019-10-09 16:57:00 +01:00
- epd-fuse.service
2019-11-07 17:41:17 +01:00
- fstrim.timer
2019-10-05 18:51:20 +02:00
disable :
- apt-daily.timer
- apt-daily.service
- apt-daily-upgrade.timer
- apt-daily-upgrade.service
- bluetooth.service
- ifup@wlan0.service
packages :
2019-10-08 14:59:12 +01:00
bettercap :
2023-08-23 14:06:28 +02:00
# We will install bettercap from source
# url: "https://github.com/jayofelony/bettercap/releases/download/2.32.1/bettercap-2.32.1.zip"
2019-10-09 00:33:19 +01:00
ui : "https://github.com/bettercap/ui/releases/download/v1.3.0/ui.zip"
2019-10-11 15:12:56 +02:00
pwngrid :
2023-08-31 20:01:54 +02:00
# url: "https://github.com/evilsocket/pwngrid/releases/download/v1.10.3/pwngrid_linux_aarch64_v1.10.3.zip"
2019-10-05 18:51:20 +02:00
apt :
2023-09-10 18:11:25 +02:00
downgrade :
- libpcap0.8-dev_1.9.1-_arm64.deb
- libpcap0.8_1.9.1-3_arm64.deb
- libpcap-dev_1.9.1-3_arm64.deb
2019-10-10 23:46:10 +01:00
hold :
2023-08-23 14:06:28 +02:00
- libpcap-dev
- libpcap0.8
- libpcap0.8-dev
2019-10-05 18:51:20 +02:00
remove :
2019-12-31 14:54:38 +01:00
- raspberrypi-net-mods
2023-08-30 11:14:59 +02:00
- dhcpcd5
2019-10-05 18:51:20 +02:00
- triggerhappy
2023-08-31 09:09:43 +02:00
- wpasupplicant
2019-10-05 18:51:20 +02:00
- nfs-common
2023-07-19 11:41:20 +02:00
- libraspberrypi0
- libraspberrypi-dev
- libraspberrypi-doc
- libraspberrypi-bin
2023-09-10 18:11:25 +02:00
- golang
2019-10-05 18:51:20 +02:00
install :
2023-08-23 14:06:28 +02:00
- bluez
- raspberrypi-kernel-headers
- git
- libgmp3-dev
- gawk
- qpdf
- bison
- flex
- make
- autoconf
- libtool
- texinfo
- gcc-arm-none-eabi
- wl
- libfl-dev
- g++
- xxd
- aircrack-ng
- time
2020-01-18 09:29:28 +01:00
- rsync
2019-10-05 18:51:20 +02:00
- vim
2023-08-23 14:06:28 +02:00
- wget
2019-10-05 18:51:20 +02:00
- screen
- build-essential
2023-08-23 14:06:28 +02:00
- dkms
2019-10-05 18:51:20 +02:00
- python3-pip
2019-10-09 13:58:30 +02:00
- python3-smbus
2019-10-05 18:51:20 +02:00
- unzip
- libopenmpi-dev
- libatlas-base-dev
2023-08-23 14:06:28 +02:00
- libelf-dev
2019-10-05 18:51:20 +02:00
- libopenjp2-7
2019-10-08 13:33:11 +01:00
- libtiff5
2019-10-05 18:51:20 +02:00
- tcpdump
- lsof
- libgstreamer1.0-0
- libavcodec58
- libavformat58
- libswscale5
- libusb-1.0-0-dev
- libnetfilter-queue-dev
2019-10-08 13:33:11 +01:00
- libopenmpi3
2019-10-05 18:51:20 +02:00
- dphys-swapfile
2023-08-23 14:06:28 +02:00
- libdbus-1-dev
- libdbus-glib-1-dev
- liblapack-dev
- libhdf5-dev
- libc-ares-dev
- libeigen3-dev
2019-10-05 18:51:20 +02:00
- fonts-dejavu
- fonts-dejavu-core
- fonts-dejavu-extra
- python3-pil
2019-10-09 16:57:00 +01:00
- python3-smbus
- libfuse-dev
2023-08-23 14:06:28 +02:00
- libatlas-base-dev
- libopenblas-dev
- libblas-dev
2019-10-09 16:57:00 +01:00
- bc
2023-08-23 14:06:28 +02:00
- libgl1-mesa-glx
- libncursesw5-dev
- libssl-dev
- libsqlite3-dev
- tk-dev
- libgdbm-dev
- libc6-dev
- libbz2-dev
- libffi-dev
- zlib1g-dev
2019-10-09 16:57:00 +01:00
- fonts-freefont-ttf
2019-10-21 16:38:53 +01:00
- fbi
2023-08-23 14:06:28 +02:00
- python3-flask
- python3-flask-cors
- python3-flaskext.wtf
- build-essential
- libpcap-dev
- libusb-1.0-0-dev
- libnetfilter-queue-dev
2023-09-16 01:44:02 +02:00
environment :
ARCHFLAGS : "-arch armv8"
2019-10-05 18:51:20 +02:00
2019-10-02 17:26:29 +01:00
tasks :
2023-09-16 01:44:02 +02:00
- name : System details
debug :
msg="{{ item }}"
with_items :
- "{{ ansible_distribution }}"
- "{{ ansible_distribution_version }}"
- "{{ ansible_distribution_major_version }}"
- "{{ ansible_architecture }}"
- "{{ ansible_machine }}"
2019-10-02 17:26:29 +01:00
- name : change hostname
2023-08-29 14:13:36 +02:00
lineinfile :
dest : /etc/hostname
regexp : '^raspberrypi'
line : "{{pwnagotchi.hostname}}"
state : present
2019-10-21 16:38:53 +01:00
when : lookup('file', '/etc/hostname') == "raspberrypi"
register : hostname
2019-10-02 17:26:29 +01:00
- name : add hostname to /etc/hosts
lineinfile :
dest : /etc/hosts
2019-10-21 16:38:53 +01:00
regexp : '^127\.0\.1\.1[ \t]+raspberrypi'
2019-10-21 17:58:00 +01:00
line : "127.0.1.1\t{{pwnagotchi.hostname}}"
2019-10-02 17:26:29 +01:00
state : present
2019-10-21 16:38:53 +01:00
when : hostname.changed
2019-10-02 17:26:29 +01:00
2019-10-21 18:41:36 +01:00
- name : disable sap plugin for bluetooth.service
lineinfile :
dest : /lib/systemd/system/bluetooth.service
regexp : '^ExecStart=/usr/lib/bluetooth/bluetoothd$'
line : 'ExecStart=/usr/lib/bluetooth/bluetoothd --noplugin=sap'
2019-10-02 17:26:29 +01:00
state : present
2023-09-10 18:11:25 +02:00
- name : configure dphys-swapfile
lineinfile :
path : /etc/dphys-swapfile
regexp : "^CONF_SWAPSIZE=.*$"
line : "CONF_SWAPSIZE=2048"
2019-10-02 17:26:29 +01:00
- name : update apt package cache
apt :
update_cache : yes
2023-08-23 14:06:28 +02:00
- name : remove unnecessary apt packages
2023-08-29 14:13:36 +02:00
become_user : root
2019-10-05 17:31:14 +01:00
apt :
2019-10-05 18:51:20 +02:00
name : "{{ packages.apt.remove }}"
2019-10-05 17:31:14 +01:00
state : absent
purge : yes
2019-10-02 17:26:29 +01:00
- name : install packages
2023-08-29 14:13:36 +02:00
become_user : root
2019-10-02 17:26:29 +01:00
apt :
2019-10-05 18:51:20 +02:00
name : "{{ packages.apt.install }}"
2019-10-02 17:26:29 +01:00
state : present
2023-09-10 18:11:25 +02:00
# Install nexmon to fix wireless scanning (takes 2.5G of space)
- name : clone nexmon repository
2023-08-31 17:11:22 +02:00
git :
2023-09-10 18:11:25 +02:00
repo : https://github.com/DrSchottky/nexmon.git
dest : /usr/local/src/nexmon
# version: bfb3fe90c881498d7ee245b38f16722c1de26fa1
register : nexmongit
2023-08-31 17:11:22 +02:00
2023-09-10 18:11:25 +02:00
- name : make firmware
shell : "source ./setup_env.sh && make"
args :
executable : /bin/bash
chdir : /usr/local/src/nexmon/
2023-08-31 17:11:22 +02:00
2023-09-10 18:11:25 +02:00
- name : choose the right kernel version (bcm43436b0)
replace :
dest : /usr/local/src/nexmon/patches/bcm43436b0/9_88_4_65/nexmon/Makefile
backup : no
regexp : "KERNEL_VERSION = .*$"
replace : "KERNEL_VERSION = 6.1"
2023-08-31 17:11:22 +02:00
2023-09-10 18:11:25 +02:00
- name : choose the right kernel release (variable) (bcm43436b0)
lineinfile :
dest : /usr/local/src/nexmon/patches/bcm43436b0/9_88_4_65/nexmon/Makefile
insertafter : "DRIVER_FOLDER_NAME = .*$"
line : "KERNEL_RELEASE = 6.1.21-v8+"
2023-08-31 17:11:22 +02:00
2023-09-10 18:11:25 +02:00
- name : choose the right kernel release (replace string) (bcm43436b0)
replace :
dest : /usr/local/src/nexmon/patches/bcm43436b0/9_88_4_65/nexmon/Makefile
backup : no
regexp : "shell uname -r"
replace : "KERNEL_RELEASE"
2023-08-31 17:11:22 +02:00
2023-09-10 18:11:25 +02:00
- name : make firmware patch (bcm43436b0)
shell : "source ./setup_env.sh && cd /usr/local/src/nexmon/patches/bcm43436b0/9_88_4_65/nexmon/ && make && make install-firmware"
args :
executable : /bin/bash
chdir : /usr/local/src/nexmon/
2023-08-31 17:11:22 +02:00
2023-09-10 18:11:25 +02:00
- name : choose the right kernel version (bcm43430a1)
replace :
dest : /usr/local/src/nexmon/patches/bcm43430a1/7_45_41_46/nexmon/Makefile
backup : no
regexp : "KERNEL_VERSION = .*$"
replace : "KERNEL_VERSION = 6.1"
2023-08-31 17:11:22 +02:00
2023-09-10 18:11:25 +02:00
- name : choose the right kernel release (variable) (bcm43430a1)
lineinfile :
dest : /usr/local/src/nexmon/patches/bcm43430a1/7_45_41_46/nexmon/Makefile
insertafter : "DRIVER_FOLDER_NAME = .*$"
line : "KERNEL_RELEASE = 6.1.21-v8+"
- name : choose the right kernel release (replace string) (bcm43430a1)
replace :
dest : /usr/local/src/nexmon/patches/bcm43430a1/7_45_41_46/nexmon/Makefile
backup : no
regexp : "shell uname -r"
replace : "KERNEL_RELEASE"
- name : make firmware patch (bcm43430a1)
shell : "source ./setup_env.sh && cd /usr/local/src/nexmon/patches/bcm43430a1/7_45_41_46/nexmon/ && make && make install-firmware"
args :
executable : /bin/bash
chdir : /usr/local/src/nexmon/
- name : choose the right kernel version (bcm43455c0)
replace :
dest : /usr/local/src/nexmon/patches/bcm43455c0/7_45_206/nexmon/Makefile
backup : no
regexp : "KERNEL_VERSION = .*$"
replace : "KERNEL_VERSION = 6.1"
- name : choose the right kernel release (variable) (bcm43455c0)
lineinfile :
dest : /usr/local/src/nexmon/patches/bcm43455c0/7_45_206/nexmon/Makefile
insertafter : "DRIVER_FOLDER_NAME = .*$"
line : "KERNEL_RELEASE = 6.1.21-v8+"
- name : choose the right kernel release (replace string) (bcm43455c0)
replace :
dest : /usr/local/src/nexmon/patches/bcm43455c0/7_45_206/nexmon/Makefile
backup : no
regexp : "shell uname -r"
replace : "KERNEL_RELEASE"
- name : make firmware patch (bcm43455c0)
shell : "source ./setup_env.sh && cd /usr/local/src/nexmon/patches/bcm43455c0/7_45_206/nexmon/ && make && make install-firmware"
args :
executable : /bin/bash
chdir : /usr/local/src/nexmon/
- name : copy modified driver (everyone but RPiZW)
copy :
src : /lib/modules/6.1.21-v8+/kernel/drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko
dest : /lib/modules/6.1.21-v8+/kernel/drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko.orig
- name : copy modified driver (everyone but RPiZW)
copy :
src : /usr/local/src/nexmon/patches/driver/brcmfmac_6.1.y-nexmon/brcmfmac.ko
dest : /lib/modules/6.1.21-v8+/kernel/drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko
- name : ensure depmod runs on reboot to load modified driver (brcmfmac)
lineinfile :
dest : /etc/rc.local
line : "/sbin/depmod -a"
# To shrink the final image, remove the nexmon directory (takes 2.5G of space) post build and installation
- name : Delete nexmon content & directory
file :
state : absent
path : /usr/local/src/nexmon/
- name : Creates custom plugin directory
file :
path : /usr/local/share/pwnagotchi/custom-plugins/
state : directory
2023-08-23 14:06:28 +02:00
2019-10-21 16:38:53 +01:00
- name : collect python pip package list
command : "pip3 list"
register : pip_output
- name : set python pip package facts
set_fact :
pip_packages : >
{{ pip_packages | default({}) | combine( { item.split()[0]: item.split()[1] } ) }}
with_items : "{{ pip_output.stdout_lines }}"
2019-10-04 23:15:47 +01:00
- name : acquire python3 pip target
command : "python3 -c 'import sys;print(sys.path.pop())'"
register : pip_target
2019-10-02 17:26:29 +01:00
2019-10-08 13:33:11 +01:00
- name : clone pwnagotchi repository
git :
2023-08-23 14:06:28 +02:00
repo : https://github.com/jayofelony/pwnagotchi.git
2019-10-08 13:33:11 +01:00
dest : /usr/local/src/pwnagotchi
2019-10-21 16:38:53 +01:00
register : pwnagotchigit
2020-04-03 19:01:40 +02:00
- name : create /usr/local/share/pwnagotchi/ folder
file :
path : /usr/local/share/pwnagotchi/
state : directory
2019-10-21 16:38:53 +01:00
- name : fetch pwnagotchi version
set_fact :
2020-01-16 18:52:40 +01:00
pwnagotchi_version : "{{ lookup('file', '/usr/local/src/pwnagotchi/pwnagotchi/_version.py') | regex_replace('.*__version__.*=.*''([0-9]+\\.[0-9]+\\.[0-9]+[A-Za-z0-9]*)''.*', '\\1') }}"
2019-10-21 16:38:53 +01:00
- name : pwnagotchi version found
debug :
msg : "{{ pwnagotchi_version }}"
2019-10-08 13:33:11 +01:00
- name : build pwnagotchi wheel
command : "python3 setup.py sdist bdist_wheel"
args :
chdir : /usr/local/src/pwnagotchi
2020-01-16 19:19:58 +01:00
when : (pwnagotchigit.changed) or (pip_packages['pwnagotchi'] is undefined) or (pip_packages['pwnagotchi'] != pwnagotchi_version)
2019-10-04 23:15:47 +01:00
2019-10-08 13:33:11 +01:00
- name : install pwnagotchi wheel and dependencies
pip :
name : "{{ lookup('fileglob', '/usr/local/src/pwnagotchi/dist/pwnagotchi*.whl') }}"
extra_args : "--no-cache-dir"
2020-01-16 19:19:58 +01:00
when : (pwnagotchigit.changed) or (pip_packages['pwnagotchi'] is undefined) or (pip_packages['pwnagotchi'] != pwnagotchi_version)
2019-10-04 23:15:47 +01:00
2023-08-23 14:06:28 +02:00
# Install go-1.20.6
- name : Install go-1.21
unarchive :
2023-09-10 18:11:25 +02:00
src : https://go.dev/dl/go1.21.1.linux-arm64.tar.gz
2023-08-23 14:06:28 +02:00
dest : /usr/local
remote_src : yes
register : golang
- name : Update .bashrc for go-1.21
blockinfile :
dest : /home/pi/.bashrc
state : present
block : |
export GOPATH=$HOME/go
export PATH=/usr/local/go/bin:$PATH:$GOPATH/bin
when : golang.changed
2023-08-31 20:01:54 +02:00
- name : download pwngrid
git :
repo : https://github.com/jayofelony/pwngrid.git
dest : /usr/local/src/
register : pwngrid
- name : install pwngrid
shell : "export GOPATH=$HOME/go && export PATH=/usr/local/go/bin:$PATH:$GOPATH/bin && make && sudo make install"
2023-09-10 18:11:25 +02:00
args :
2023-08-31 20:01:54 +02:00
executables : /bin/bash
2023-09-10 18:11:25 +02:00
chdir : /usr/local/src/pwngrid
2023-08-31 20:01:54 +02:00
when : pwngrid.changed
2023-08-23 14:06:28 +02:00
- name : Install bettercap v2.32.1
shell : "export GOPATH=$HOME/go && export PATH=/usr/local/go/bin:$PATH:$GOPATH/bin && go env -w GO111MODULE=off && go get github.com/jayofelony/bettercap && cd $GOPATH/src/github.com/jayofelony/bettercap && make build && make install"
args :
executable : /bin/bash
register : bettercap
2019-10-02 17:26:29 +01:00
- name : clone bettercap caplets
git :
2023-08-26 00:54:31 +02:00
repo : https://github.com/jayofelony/caplets.git
2019-10-02 17:26:29 +01:00
dest : /tmp/caplets
2019-10-21 16:38:53 +01:00
register : capletsgit
2019-10-02 17:26:29 +01:00
2023-08-29 21:02:43 +02:00
- name : install bettercap caplets
make :
chdir : /tmp/caplets
target : install
when : capletsgit.changed
- name : download and install bettercap ui
unarchive :
src : "{{ packages.bettercap.ui }}"
dest : /usr/local/share/bettercap/
remote_src : yes
mode : 0755
2019-10-08 13:33:11 +01:00
- name : add HDMI powersave to rc.local
2019-10-02 17:26:29 +01:00
blockinfile :
path : /etc/rc.local
insertbefore : "exit 0"
block : |
2019-10-27 10:38:28 +02:00
if ! /opt/vc/bin/tvservice -s | egrep 'HDMI|DVI'; then
2019-10-02 17:26:29 +01:00
/opt/vc/bin/tvservice -o
fi
2019-10-10 23:46:10 +01:00
- name : create /etc/pwnagotchi folder
2023-08-29 14:13:36 +02:00
become_user : root
2019-10-10 23:46:10 +01:00
file :
path : /etc/pwnagotchi
state : directory
- name : check if user configuration exists
2023-08-29 14:13:36 +02:00
become_user : root
2019-10-10 23:46:10 +01:00
stat :
2020-04-14 21:53:17 +02:00
path : /etc/pwnagotchi/config.toml
2019-10-10 23:46:10 +01:00
register : user_config
2020-04-14 21:53:17 +02:00
- name : create /etc/pwnagotchi/config.toml
2023-08-29 14:13:36 +02:00
become_user : root
2019-10-10 23:46:10 +01:00
copy :
2020-04-14 21:53:17 +02:00
dest : /etc/pwnagotchi/config.toml
2019-10-10 23:46:10 +01:00
content : |
2020-04-14 21:53:17 +02:00
# Add your configuration overrides on this file any configuration changes done to default.toml will be lost!
2019-10-10 23:46:10 +01:00
# Example:
2020-04-14 21:53:17 +02:00
# ui.display.enabled = true
# ui.display.type = "waveshare_2"
2019-10-10 23:46:10 +01:00
when : not user_config.stat.exists
2019-10-05 23:23:31 +02:00
2019-10-02 17:26:29 +01:00
- name : enable ssh on boot
2023-08-29 14:13:36 +02:00
become_user : root
2019-10-02 17:26:29 +01:00
file :
path : /boot/ssh
state : touch
- name : adjust /boot/config.txt
2023-08-29 14:13:36 +02:00
become_user : root
2019-10-02 17:26:29 +01:00
lineinfile :
dest : /boot/config.txt
insertafter : EOF
line : '{{ item }}'
2019-10-10 23:46:10 +01:00
with_items : "{{system.boot_options}}"
2019-10-02 17:26:29 +01:00
2019-10-21 16:38:53 +01:00
- name : adjust /etc/modules
2023-08-29 14:13:36 +02:00
become_user : root
2019-10-21 16:38:53 +01:00
lineinfile :
dest : /etc/modules
insertafter : EOF
line : '{{ item }}'
with_items : "{{system.modules}}"
2019-10-02 17:26:29 +01:00
- name : change root partition
2023-08-29 14:13:36 +02:00
become_user : root
2019-10-02 17:26:29 +01:00
replace :
dest : /boot/cmdline.txt
backup : no
regexp : "root=PARTUUID=[a-zA-Z0-9\\-]+"
replace : "root=/dev/mmcblk0p2"
- name : configure /boot/cmdline.txt
2023-08-29 14:13:36 +02:00
become_user : root
2019-10-02 17:26:29 +01:00
lineinfile :
path : /boot/cmdline.txt
backrefs : True
state : present
backup : no
regexp : '(.*)$'
2019-10-05 20:42:42 +01:00
line : '\1 modules-load=dwc2,g_ether'
2019-10-02 17:26:29 +01:00
2023-09-20 09:02:37 +02:00
- name : configure 01-motd
2023-08-29 14:13:36 +02:00
become_user : root
2019-10-02 17:26:29 +01:00
copy :
2023-09-20 10:42:13 +02:00
dest : /etc/update-motd.d/01-motd
2019-10-11 12:51:57 +01:00
content : |
2023-09-20 10:42:13 +02:00
#!/bin/sh
_hostname=$(hostname)
_version=$(cut -d"'" -f2 < /usr/local/lib/python3.9/dist-packages/pwnagotchi/_version.py)
echo
echo "(◕‿‿◕) $_hostname"
echo
echo "Hi! I'm a pwnagotchi $_version, please take good care of me!"
echo "Here are some basic things you need to know to raise me properly!"
echo
echo "If you want to change my configuration, use /etc/pwnagotchi/config.toml"
echo
echo "All the configuration options can be found on /etc/pwnagotchi/default.toml,"
echo "but don't change this file because I will recreate it every time I'm restarted!"
echo
echo "I use oPwnGrid as my main API, you can check stats at https://opwngrid.xyz"
echo
echo "I'm managed by systemd. Here are some basic commands."
echo
echo "If you want to know what I'm doing, you can check my logs with the command"
echo "- pwnlog"
echo "- pwnver, to check the current version"
echo "- sudo pwnagotchi --donate, to see how you can donate to this project"
echo "- sudo pwnagotchi --check-update, to see if there is a new version available"
echo
echo "If you want to know if I'm running, you can use"
echo "systemctl status pwnagotchi"
echo
echo "You can restart me using"
echo "systemctl restart pwnagotchi"
echo
echo "You learn more about me at https://pwnagotchi.ai/"
2019-10-21 16:38:53 +01:00
when : hostname.changed
2019-10-02 17:26:29 +01:00
2023-09-10 18:11:25 +02:00
- name : Add pwnlog alias
lineinfile :
dest : /home/pi/.bashrc
line : "\nalias pwnlog='tail -f -n300 /var/log/pwn*.log | sed --unbuffered \"s/,[[:digit:]]\\{3\\}\\]//g\" | cut -d \" \" -f 2-'"
insertafter : EOF
- name : Add pwnlog alias
lineinfile :
dest : /home/pi/.bashrc
line : "\nalias pwnver='python3 -c \"import pwnagotchi as p; print(p.__version__)\"'"
insertafter : EOF
- name : download old libpcap packages
get_url :
url : "http://ports.ubuntu.com/pool/main/libp/libpcap/{{ item }}"
dest : /usr/local/src/
with_items : "{{ packages.apt.downgrade }}"
- name : install old libpcap packages
become_user : root
apt :
deb : /usr/local/src/libpcap*
args : allow-downgrades
register : libpcap
- name : add firmware packages to hold
become_user : root
dpkg_selections :
name : "{{ item }}"
selection : hold
with_items : "{{ packages.apt.hold }}"
when : libpcap.changed
2019-10-02 17:26:29 +01:00
- name : clean apt cache
2023-08-29 14:13:36 +02:00
become_user : root
2019-10-02 17:26:29 +01:00
apt :
autoclean : yes
- name : remove dependencies that are no longer required
apt :
autoremove : yes
2019-10-05 18:51:20 +02:00
- name : disable unecessary services
2023-08-29 14:13:36 +02:00
become_user : root
2019-10-05 18:51:20 +02:00
systemd :
2019-10-08 13:33:11 +01:00
name : "{{ item }}"
2019-10-05 18:51:20 +02:00
state : stopped
enabled : no
2019-10-08 13:33:11 +01:00
with_items : "{{ services.disable }}"
2019-10-05 18:51:20 +02:00
2019-10-02 17:26:29 +01:00
- name : remove ssh keys
2023-08-29 14:13:36 +02:00
become_user : root
2019-10-02 17:26:29 +01:00
file :
state : absent
2023-09-10 18:11:25 +02:00
path : "{{ item }}"
2019-10-05 18:51:20 +02:00
with_fileglob :
- "/etc/ssh/ssh_host*_key*"
2019-10-08 13:33:11 +01:00
handlers :
- name : reload systemd services
2023-08-29 14:13:36 +02:00
become_user : root
2019-10-08 13:33:11 +01:00
systemd :
2023-09-13 07:21:50 +02:00
daemon_reload : yes