diff options
| author | Luke Hoersten <[email protected]> | 2026-07-28 21:11:08 -0500 |
|---|---|---|
| committer | Luke Hoersten <[email protected]> | 2026-07-28 21:11:08 -0500 |
| commit | 207bff9cb9773e3e0ef7fe7114e4b1aa70ffd4b6 (patch) | |
| tree | cc38ab4e2cb82ecdc9a8e4d03b3afbe2f6af6be0 /mattertimectl/controller/tasks | |
| parent | a55c5e9d35530d03fa8c52ceef5d2457827f0851 (diff) | |
- Rename role dir and all vars from mattertimesync to mattertimectl
- Rename the server subrole to controller
- Build via cargo instead of npm; run the binary directly (no node)
- Default fabricLabel to "Matter Time Controller"
Diffstat (limited to 'mattertimectl/controller/tasks')
| -rw-r--r-- | mattertimectl/controller/tasks/main.yaml | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/mattertimectl/controller/tasks/main.yaml b/mattertimectl/controller/tasks/main.yaml new file mode 100644 index 0000000..a77145c --- /dev/null +++ b/mattertimectl/controller/tasks/main.yaml @@ -0,0 +1,80 @@ +--- + +- name: add mattertimectl user + become: yes + user: + name: "{{mattertimectl_user}}" + system: "yes" + shell: "/usr/sbin/nologin" + home: "{{mattertimectl_storage_path}}" + create_home: "no" + +- name: create mattertimectl directories + become: yes + file: + path: "{{item.path}}" + state: "directory" + owner: "{{item.owner}}" + group: "{{item.owner}}" + mode: "{{item.mode}}" + loop: + - { path: "{{mattertimectl_install_dir}}", owner: "root", mode: "0755" } + - { path: "{{mattertimectl_config_dir}}", owner: "root", mode: "0755" } + - { path: "{{mattertimectl_storage_path}}", owner: "{{mattertimectl_user}}", mode: "0700" } + +- name: check installed mattertimectl version + become: yes + stat: + path: "{{mattertimectl_install_dir}}/.installed-{{mattertimectl_version}}" + register: mattertimectl_installed + +- name: install mattertimectl bundle + become: yes + unarchive: + remote_src: yes + src: "{{mattertimectl_bin_url}}" + dest: "{{mattertimectl_install_dir}}/" + owner: "root" + group: "root" + when: not mattertimectl_installed.stat.exists + +- name: stamp installed mattertimectl version + become: yes + copy: + dest: "{{mattertimectl_install_dir}}/.installed-{{mattertimectl_version}}" + content: "{{mattertimectl_version}}\n" + mode: "0644" + when: not mattertimectl_installed.stat.exists + +- name: configure mattertimectl + become: yes + template: + src: "config.json.j2" + dest: "{{mattertimectl_config_dir}}/config.json" + owner: "root" + group: "{{mattertimectl_user}}" + mode: "0640" + +- name: install mattertimectl systemd service + become: yes + template: + src: "mattertimectl.service.j2" + dest: "/etc/systemd/system/mattertimectl.service" + mode: "0644" + notify: reload systemd + +- name: install mattertimectl systemd timer + become: yes + template: + src: "mattertimectl.timer.j2" + dest: "/etc/systemd/system/mattertimectl.timer" + mode: "0644" + notify: reload systemd + +- name: enable mattertimectl timer + become: yes + systemd: + name: "mattertimectl.timer" + enabled: "yes" + state: "started" + daemon_reload: "yes" |
