2017-05-27 18:09:50 +00:00
# Setup specific to the Raspberry Pi
2018-02-13 02:04:25 +00:00
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"
2018-02-13 02:04:25 +00:00
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-03 01:44:03 +00:00
- name : Check for need to enable i2c-rtc device in /boot/config.txt (requires reboot!)
2018-02-13 02:04:25 +00:00
lineinfile :
dest : /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
2017-05-27 18:09:50 +00:00
when : rtc_id != "none"
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 != "none"
2018-02-13 02:04:25 +00:00
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 != "none"
2018-11-03 01:44:03 +00:00
- name : Install latest ntp package
2018-02-13 02:04:25 +00:00
package :
2018-11-03 01:44:03 +00:00
name : ntp
2018-02-13 02:04:25 +00:00
state : latest
2017-05-27 18:09:50 +00:00
2018-11-03 01:44:03 +00:00
- name : Increase swap file size (to CONF_SWAPSIZE=500 in /etc/dphys-swapfile) as kalite pip download fails (debuntu)
2018-02-13 02:04:25 +00:00
lineinfile :
regexp : "^CONF_SWAPSIZE"
line : CONF_SWAPSIZE=500
2018-11-03 01:44:03 +00:00
path : /etc/dphys-swapfile
2017-05-27 23:10:45 +00:00
when : is_debuntu
2017-05-27 18:09:50 +00:00
2018-02-13 02:04:25 +00:00
- name : Restart the swap service (debuntu)
2017-05-27 18:09:50 +00:00
command : /etc/init.d/dphys-swapfile restart
2017-05-27 23:10:45 +00:00
when : is_debuntu
2017-05-27 18:09:50 +00:00
2018-11-03 01:44:03 +00:00
- name : Add RPi rootfs resizing systemd service
2018-02-13 02:04:25 +00:00
template :
src : "{{ item.src }}"
dest : "{{ item.dest }}"
owner : root
group : root
mode : "{{ item.mode }}"
2017-05-27 18:09:50 +00:00
with_items :
2017-06-09 23:25:56 +00:00
- { 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
- name : Enable rootfs resizing service
2018-02-13 02:04:25 +00:00
service :
name : iiab-rpi-root-resize
enabled : yes