1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 19:52:06 +00:00
iiab/roles/1-prep/tasks/raspberry_pi_2.yml

58 lines
1.7 KiB
YAML
Raw Normal View History

2017-05-27 18:09:50 +00:00
# Setup specific to the Raspberry Pi
#
- name: Add a udev rule to transfer hwclock to system clock at dev creation
template: src=92-rtc-i2c.rules
dest=/etc/udev/rules.d/92-rtc-i2c.rules
owner=root
group=root
mode=0644
when: rtc_id is defined and rtc_id != "none"
#
# RTC requires a change to the device tree (and reboot)
- name: Check for needing to enable i2c rtc device in config.txt
lineinfile: dest=/boot/config.txt
line="dtoverlay=i2c-rtc,{{ rtc_id }}=on"
state=present
register: rpiconfig
when: rtc_id != "none"
- name: Add a udev rule to transfer hwclock to system clock at dev creation
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-10-31 03:29:32 +00:00
- name: Pre-install packages
2017-05-27 18:09:50 +00:00
package: name={{ item }}
state=latest
with_items:
- ntp
2017-10-31 03:29:32 +00:00
- name: Increase the swap file size (kalite pip download fails)
2017-05-27 18:09:50 +00:00
lineinfile: regexp="^CONF_SWAPSIZE"
line=CONF_SWAPSIZE=500
dest=/etc/dphys-swapfile
2017-05-27 23:10:45 +00:00
when: is_debuntu
2017-05-27 18:09:50 +00:00
2017-10-31 03:29:32 +00:00
- name: Restart the swap service
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
2017-10-31 03:29:32 +00:00
- name: Add RPi rootfs resizing service
2017-05-27 18:09:50 +00:00
template: src={{ item.src }}
dest={{ item.dest }}
owner=root
group=root
mode={{ item.mode }}
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
- name: Enable rootfs resizing service
service: name=iiab-rpi-root-resize
2017-05-27 18:09:50 +00:00
enabled=yes