ansible/roles/pi_fan_hwpwm/tasks/alpine.yml

59 lines
1.2 KiB
YAML

---
- name: install necessary packages
apk:
name:
- gcc
- git
- make
- musl-dev
- tar
state: present
- name: let builder own the src directory
file:
state: directory
path: /var/lib/builder/src
owner: builder
group: builder
- name: clone git repo
git:
repo: https://github.com/kubesail/pibox-os.git
dest: /var/lib/builder/src/pibox-os
clone: true
become_user: builder
- name: build and install bcm2835-1.68
include_tasks: bcm2835.yml
- name: build and install pi_fan_hwpwm
include_tasks: pi_fan_hwpwm.yml
- name: copy init script
copy:
src: init.d/pi_fan_hwpwm
dest: /etc/init.d/pi_fan_hwpwm
owner: root
mode: '0755'
- name: enable pi_fan_hwpwm
service:
name: pi_fan_hwpwm
state: started
enabled: true
runlevel: default
- name: add files to lbu
lbu:
include:
- /usr/local/sbin/pi_fan_hwpwm
- /etc/init.d/pi_fan_hwpwm
when: ansible_distribution == "Alpine" and alpine_mode in ["diskless", "data"]
- name: add iomem=relaxed to cmdline.txt
replace:
path: /media/mmcblk0p1/cmdline.txt
regexp: '^([\w](?!.*\biomem=relaxed\b).*)$'
replace: '\1 iomem=relaxed'