From 5eaa5baf3b3b33745c9d0612a3a34c7b61d13822 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Sat, 14 Mar 2020 22:30:45 -0500 Subject: [PATCH] ubuntu mounts the first partition differently - limit swapfile mods to raspbian --- roles/1-prep/tasks/raspberry_pi.yml | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/roles/1-prep/tasks/raspberry_pi.yml b/roles/1-prep/tasks/raspberry_pi.yml index 5253fb95a..a6b4b3a33 100644 --- a/roles/1-prep/tasks/raspberry_pi.yml +++ b/roles/1-prep/tasks/raspberry_pi.yml @@ -10,22 +10,19 @@ when: rtc_id is defined and rtc_id != "none" # RTC requires a change to the device tree (and reboot) -- 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" +- 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" and is_raspbian lineinfile: path: /boot/config.txt line: "dtoverlay=i2c-rtc,{{ rtc_id }}=on" state: present - register: rpiconfig # HMMM REGISTER "rpiconfig" IS *COMPLETELY UNUSED* AS OF 2018-11-02 - when: rtc_id is defined and rtc_id != "none" + when: rtc_id is defined and rtc_id != "none" and is_raspbian -#- 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" +- name: Enable i2c-rtc device (with "dtoverlay=i2c-rtc,{{ rtc_id }}=on" in /boot/firmware/config.txt, requires reboot!) if rtc_id is defined and rtc_id != "none" and is_ubuntu + lineinfile: + path: /boot/firmware/config.txt + line: "dtoverlay=i2c-rtc,{{ rtc_id }}=on" + state: present + when: rtc_id is defined and rtc_id != "none" and is_ubuntu - name: Install latest ntp package package: @@ -37,14 +34,14 @@ path: /etc/dphys-swapfile regexp: "^CONF_SWAPSIZE" line: "CONF_SWAPSIZE={{ pi_swap_file_size }}" - when: is_debuntu | bool # Redundant, given raspberry_pi.yml is only run when rpi_model: != "none" Until someone tries a non-debuntu OS on RPi? + when: is_raspbian | bool - 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 + when: is_raspbian | bool - name: Install RPi rootfs resizing (iiab-rpi-max-rootfs.sh) and its systemd service (iiab-rpi-root-resize.service), from templates template: