2024-06-13 21:05:10 +00:00
|
|
|
---
|
|
|
|
- hosts: pi
|
|
|
|
gather_facts: no
|
|
|
|
tasks:
|
2024-06-13 21:45:11 +00:00
|
|
|
## LCD STUFF
|
2024-06-13 21:05:10 +00:00
|
|
|
- name: Enable i2c on boot/config.txt
|
|
|
|
lineinfile:
|
|
|
|
dest: /boot/config.txt
|
|
|
|
regexp: "^#?dtparam=i2c_arm="
|
|
|
|
line: "dtparam=i2c_arm=on"
|
|
|
|
insertafter: EOF
|
|
|
|
state: present
|
|
|
|
|
|
|
|
- name: Enable i2c module
|
|
|
|
lineinfile:
|
|
|
|
dest: /etc/modules-load.d/raspberrypi.conf
|
|
|
|
regexp: "^#?i2c"
|
|
|
|
line: "i2c-dev"
|
|
|
|
insertafter: EOF
|
|
|
|
state: present
|
|
|
|
|
|
|
|
- name: Copy systemd unit files
|
|
|
|
ansible.builtin.copy:
|
|
|
|
src: files/display.service
|
|
|
|
dest: /etc/systemd/system/
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
|
|
|
register: display_service
|
|
|
|
tags: display
|
|
|
|
|
|
|
|
- name: Reload systemd
|
|
|
|
ansible.builtin.systemd:
|
|
|
|
daemon_reload: yes
|
|
|
|
when: display_service.changed
|
|
|
|
tags: display
|
|
|
|
|
|
|
|
- name: Enable display service
|
|
|
|
ansible.builtin.systemd:
|
|
|
|
name: display
|
|
|
|
enabled: yes
|
|
|
|
state: started
|
|
|
|
tags: display
|
|
|
|
|
2024-06-13 21:45:11 +00:00
|
|
|
## Now the most important part: PPS
|
|
|
|
- name: Add PPS tools
|
|
|
|
package:
|
|
|
|
name: pps-tools
|
|
|
|
state: present
|
|
|
|
|
|
|
|
- name: PPS on GPIO
|
|
|
|
lineinfile:
|
|
|
|
dest: /boot/config.txt
|
|
|
|
regexp: "^dtoverlay=pps-gpio"
|
|
|
|
line: "dtoverlay=pps-gpio,gpiopin=18"
|
|
|
|
state: present
|
|
|
|
|
2024-06-13 21:05:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- hosts: all
|
|
|
|
tasks:
|
|
|
|
# - name: Install chrony
|
|
|
|
# package:
|
|
|
|
# name: chrony
|
|
|
|
# state: present
|
|
|
|
# notify: restart chrony
|
|
|
|
|
|
|
|
- name: Configure chrony
|
|
|
|
template:
|
|
|
|
src: files/chrony.conf.j2
|
|
|
|
dest: /etc/chrony.conf
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
|
|
|
notify: restart chrony
|
|
|
|
|
|
|
|
- name: Enable chrony
|
|
|
|
service:
|
|
|
|
name: chronyd
|
|
|
|
enabled: yes
|
|
|
|
state: started
|
|
|
|
|
|
|
|
handlers:
|
|
|
|
- name: restart chrony
|
|
|
|
service:
|
|
|
|
name: chronyd
|
|
|
|
state: restarted
|