1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 11:42:08 +00:00
iiab/roles/1-prep/tasks/raspberry_pi.yml

64 lines
2.5 KiB
YAML
Raw Normal View History

2018-11-04 02:38:22 +00:00
# Specific to Raspberry Pi
2018-11-03 01:44:03 +00:00
- name: Install udev rule /etc/udev/rules.d/92-rtc-i2c.rules from template, to transfer hwclock to system clock at dev creation, if rtc_id is defined and rtc_id != "none"
template:
src: 92-rtc-i2c.rules
dest: /etc/udev/rules.d/92-rtc-i2c.rules
owner: root
group: root
mode: 0644
2017-05-27 18:09:50 +00:00
when: rtc_id is defined and rtc_id != "none"
# RTC requires a change to the device tree (and reboot)
2018-11-04 03:46:22 +00:00
- name: Enable i2c-rtc device (with "dtoverlay=i2c-rtc,{{ rtc_id }}=on" in /boot/config.txt, requires reboot!) if rtc_id is defined and rtc_id != "none"
lineinfile:
2018-11-04 02:38:22 +00:00
path: /boot/config.txt
line: "dtoverlay=i2c-rtc,{{ rtc_id }}=on"
state: present
2018-11-03 01:44:03 +00:00
register: rpiconfig # HMMM REGISTER "rpiconfig" IS *COMPLETELY UNUSED* AS OF 2018-11-02
2018-11-04 02:38:22 +00:00
when: rtc_id is defined and rtc_id != "none"
2017-05-27 18:09:50 +00:00
2018-11-04 02:38:22 +00:00
#- name: Install udev rule /etc/udev/rules.d/92-rtc-i2c.rules from template, to transfer hwclock to system clock at dev creation, if rtc_id != "none"
# template:
# src: 92-rtc-i2c.rules
# dest: /etc/udev/rules.d/92-rtc-i2c.rules
# owner: root
# group: root
# mode: 0644
# when: rtc_id != "none"
2017-05-27 18:09:50 +00:00
2018-11-03 01:44:03 +00:00
- name: Install latest ntp package
package:
2018-11-03 01:44:03 +00:00
name: ntp
state: latest
2017-05-27 18:09:50 +00:00
2019-08-13 20:20:24 +00:00
- name: Increase swap file size (to CONF_SWAPSIZE={{ pi_swap_file_size }} in /etc/dphys-swapfile) as kalite pip download fails (debuntu)
lineinfile:
2018-11-04 02:38:22 +00:00
path: /etc/dphys-swapfile
regexp: "^CONF_SWAPSIZE"
2019-08-13 20:20:24 +00:00
line: "CONF_SWAPSIZE={{ pi_swap_file_size }}"
when: is_debuntu | bool # Redundant, given raspberry_pi.yml is only run when rpi_model: "rpi" (similar to is_rpi: True). Until someone tries a non-debuntu OS on RPi?
2017-05-27 18:09:50 +00:00
2018-11-04 02:38:22 +00:00
- name: Restart swap service "dphys-swapfile" (debuntu)
#command: /etc/init.d/dphys-swapfile restart
service: # A rare/legacy service that is NOT systemd
name: dphys-swapfile
state: restarted
when: is_debuntu | bool
2017-05-27 18:09:50 +00:00
2018-11-04 02:38:22 +00:00
- name: Install RPi rootfs resizing (iiab-rpi-max-rootfs.sh) and its systemd service (iiab-rpi-root-resize.service), from templates
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
owner: root
group: root
mode: "{{ item.mode }}"
2017-05-27 18:09:50 +00:00
with_items:
- { src: 'iiab-rpi-max-rootfs.sh', dest: '/usr/sbin/iiab-rpi-max-rootfs.sh', mode: '0755'}
- { src: 'iiab-rpi-root-resize.service', dest: '/etc/systemd/system/iiab-rpi-root-resize.service', mode: '0644'}
2017-05-27 18:09:50 +00:00
2018-11-04 02:38:22 +00:00
- name: Enable RPi rootfs resizing (systemd service iiab-rpi-root-resize.service)
systemd:
name: iiab-rpi-root-resize
enabled: yes