testing on rpi

This commit is contained in:
2023-11-03 11:57:46 +01:00
parent a6c139ec08
commit 2001874ecb
4 changed files with 41 additions and 14 deletions

View File

@@ -1,22 +1,37 @@
- name: Basic setup tasks for Raspberry Pi
hosts: raspberrypi
become: true
hosts: all
user: remy
# become: true
vars:
code_dest: /home/pi/eink
code_dest: /home/remy/eink
service_target_dir: /etc/systemd/system/
tasks:
- name: Pull the latest version of the code
git:
repo: https://git.kluster.moll.re/remoll/eink.git
repo: https://git.kluster.moll.re/remoll/rpi-eink-picture-frame
dest: "{{ code_dest }}"
version: main
- name: Install pillow dependencies
apt:
name:
- libjpeg-dev
- zlib1g
state: present
become: true
- name: Install from the pipenv-file
command: "pipenv install --system --deploy --categories=\"packages prod-packages\""
args:
chdir: "{{ code_dest }}"
- name: Copy keys python file
copy:
src: ../keys.py
dest: "{{ code_dest }}/keys.py"
- name: Copy unit files
template:
src: ./templates/{{ item }}.j2
@@ -24,6 +39,7 @@
loop:
- eink-show.service
- eink-show.timer
become: true
- name: Enable units
systemd:
@@ -33,4 +49,5 @@
enabled: yes
loop:
- eink-show.service
- eink-show.timer
- eink-show.timer
become: true

View File

@@ -1,5 +1,6 @@
- name: Basic setup tasks for Raspberry Pi
hosts: raspberrypi
hosts: all
user: remy
become: true
tasks:
@@ -19,13 +20,18 @@
apt:
name:
- git
- python3-pipenv
- python3-pip
- python3-dev
- python3-setuptools
- python3-rpi.gpio
- python3-spidev
state: present
- name: Pip install pipenv
pip:
name: pipenv
state: present
- name: Enable SPI and I2C interfaces
lineinfile:
path: /boot/config.txt
@@ -38,7 +44,6 @@
- name: Reboot the Raspberry Pi
reboot:
delay: 5
connect_timeout: 20
reboot_timeout: 300