1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 03:32:12 +00:00

Merge pull request #2289 from jvonau/rtc

Rtc
This commit is contained in:
A Holt 2020-03-19 10:48:10 -04:00 committed by GitHub
commit d05cf41731
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 30 deletions

View file

@ -18,7 +18,7 @@ exFAT_enabled: False
is_F18: False
# Set default 1-prep discovered hardware
rtc_id: ds3231
rtc_id: none
NUC6_firmware_needed: False
# Used in 2-common/tasks/xo.yml

View file

@ -77,19 +77,6 @@
name: openvpn
when: openvpn_install | bool
# for rpi, without rtc, we need time as soon as possible
- name: Install chrony (an NTP package) especially for RPi's lacking RTC
package:
name: chrony
state: present
#TODO: Use regexp filter instead of hard-code ip
- name: Install /etc/chrony.conf from template
template:
src: chrony.conf.j2
dest: /etc/chrony.conf
backup: no
# Debian 10 "Buster" is apparently enabling AppArmor in 2019:
# https://wiki.debian.org/AppArmor/Progress
# https://wiki.debian.org/AppArmor/HowToUse

View file

@ -10,41 +10,47 @@
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/usercfg.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
- name: Enable bluetooth in /boot/firmware/syscfg.txt on Ubuntu (needs reboot)
lineinfile:
path: /boot/firmware/syscfg.txt
regexp: '^include*'
line: 'include btcfg.txt'
when: is_ubuntu
- name: Ensure dphys-swapfile fake-hwclock iw rkill are installed
package:
name: ntp
state: latest
name:
- dphys-swapfile
- fake-hwclock
- iw
- rfkill
state: present
- name: Increase swap file size (to CONF_SWAPSIZE={{ pi_swap_file_size }} in /etc/dphys-swapfile) as kalite pip download fails (debuntu)
lineinfile:
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?
- 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
- name: Install RPi rootfs resizing (iiab-rpi-max-rootfs.sh) and its systemd service (iiab-rpi-root-resize.service), from templates
template: