|
4 | 4 | name: linuxptp
|
5 | 5 | state: present
|
6 | 6 |
|
7 |
| -# TODO: Set up NIC as grandmaster, configure phc2sys, and set up testptp |
8 |
| -# See: https://github.com./geerlingguy/time-pi/issues/1 |
9 |
| -# sudo ptp4l -i eth1 -m |
| 7 | +- name: Copy ts2phc systemd unit file into place. |
| 8 | + ansible.builtin.template: |
| 9 | + src: ts2phc.unit.j2 |
| 10 | + dest: /etc/systemd/system/ts2phc.service |
| 11 | + owner: root |
| 12 | + group: root |
| 13 | + mode: 0755 |
| 14 | + notify: Restart ts2phc |
| 15 | + |
| 16 | +- name: Ensure ts2phc service is in the correct state. |
| 17 | + ansible.builtin.service: |
| 18 | + name: ts2phc |
| 19 | + state: "{{ ts2phc_service_state }}" |
| 20 | + enabled: "{{ ts2phc_service_enabled }}" |
| 21 | + |
| 22 | +- name: Copy phc2sys systemd unit file into place. |
| 23 | + ansible.builtin.template: |
| 24 | + src: phc2sys.unit.j2 |
| 25 | + dest: /etc/systemd/system/phc2sys.service |
| 26 | + owner: root |
| 27 | + group: root |
| 28 | + mode: 0755 |
| 29 | + notify: Restart phc2sys |
| 30 | + |
| 31 | +- name: Ensure phc2sys service is in the correct state. |
| 32 | + ansible.builtin.service: |
| 33 | + name: phc2sys |
| 34 | + state: "{{ phc2sys_service_state }}" |
| 35 | + enabled: "{{ phc2sys_service_enabled }}" |
| 36 | + |
| 37 | +- name: Add ptp4l configuration. |
| 38 | + ansible.builtin.template: |
| 39 | + src: "templates/ptp4l.conf.j2" |
| 40 | + dest: "/etc/ptp4l.conf" |
| 41 | + mode: 0644 |
| 42 | + notify: Restart ptp4l |
| 43 | + |
| 44 | +- name: Copy ptp4l systemd unit file into place. |
| 45 | + ansible.builtin.template: |
| 46 | + src: ptp4l.unit.j2 |
| 47 | + dest: /etc/systemd/system/ptp4l.service |
| 48 | + owner: root |
| 49 | + group: root |
| 50 | + mode: 0755 |
| 51 | + notify: Restart ptp4l |
| 52 | + |
| 53 | +- name: Ensure ptp4l service is in the correct state. |
| 54 | + ansible.builtin.service: |
| 55 | + name: ptp4l |
| 56 | + state: "{{ ptp4l_service_state }}" |
| 57 | + enabled: "{{ ptp4l_service_enabled }}" |
0 commit comments