diff options
| author | Luke Hoersten <[email protected]> | 2026-07-26 11:49:11 -0500 |
|---|---|---|
| committer | Luke Hoersten <[email protected]> | 2026-07-26 11:49:11 -0500 |
| commit | 1566ed593907c829827237aad924c3f527723218 (patch) | |
| tree | 931230eb48dda06b86ddea2f91d4e7e6765ccb4c /mattertimesync/build/tasks/main.yaml | |
| parent | 38323823b85b2ae8deef788a0f49e36c789c12f4 (diff) | |
mattertimesync: add build + server roles
Build role compiles the tagged source on the build host (npm ci + npm run
bundle) into a versioned mattertimesync-<ver>.tar.gz in build_srv_dir. Server
role installs the single bundled .mjs, creates the mattertimesync service user
and a 0700 storage dir for the Matter fabric keys, templates config.json, and
runs a hardened oneshot sync via a systemd timer. Both roles depend on the
nodejs role for Node >=20.
Diffstat (limited to 'mattertimesync/build/tasks/main.yaml')
| -rw-r--r-- | mattertimesync/build/tasks/main.yaml | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/mattertimesync/build/tasks/main.yaml b/mattertimesync/build/tasks/main.yaml new file mode 100644 index 0000000..68c9da0 --- /dev/null +++ b/mattertimesync/build/tasks/main.yaml @@ -0,0 +1,41 @@ +--- + +- name: unarchive mattertimesync source + unarchive: + remote_src: yes + src: "{{mattertimesync_tar}}" + dest: "/tmp/" + creates: "{{mattertimesync_build_dir}}" + +- name: check if mattertimesync build exists + stat: + path: "{{mattertimesync_srv_dir}}/mattertimesync-{{mattertimesync_version}}.tar.gz" + register: build_file + +- name: install mattertimesync build dependencies + command: "npm ci" + args: + chdir: "{{mattertimesync_build_dir}}" + when: not build_file.stat.exists + +- name: bundle mattertimesync + command: "npm run bundle" + args: + chdir: "{{mattertimesync_build_dir}}" + creates: "{{mattertimesync_build_dir}}/mattertimesync.mjs" + when: not build_file.stat.exists + +- name: create build server dir + become: yes + file: + path: "{{mattertimesync_srv_dir}}" + mode: "0755" + state: "directory" + +- name: create gz archive of mattertimesync bundle + become: yes + archive: + path: "{{mattertimesync_build_dir}}/mattertimesync.mjs" + dest: "{{mattertimesync_srv_dir}}/mattertimesync-{{mattertimesync_version}}.tar.gz" + format: "gz" + when: not build_file.stat.exists |
