ansible/roles/i2c-clock/tasks/install.yml
2021-07-01 19:59:40 +02:00

37 lines
798 B
YAML

---
- become: yes
block:
- name: install i2c-tools
become: yes
apt:
update_cache: yes
pkg:
- i2c-tools
- libraspberrypi-bin
- name: enable i2c-rtc dtoverlay
shell:
cmd: |
dtoverlay i2c-rtc
- name: enable automatic module load
copy:
src: etc/modules-load.d/rtc-ds1307.conf
dest: /etc/modules-load.d/rtc-ds1307.conf
- name: add systemd service
copy:
src: etc/systemd/system/rtc-i2c.service
dest: /etc/systemd/system/rtc-i2c.service
- name: disable systemd service
systemd:
daemon_reload: yes
name: rtc-i2c.service
enabled: no
- name: enable systemd service
systemd:
name: rtc-i2c.service
enabled: yes