--- # ------------------------------------------------------------------------------ # FILE: roles/llm-inference-multimodel/tasks/systemd.yml # DESCRIPTION: Phase 2 — template + deploy both unit files. # DELIBERATELY DOES NOT START OR ENABLE either service — that is # Phase 4 (verify.yml)'s job, after Phase 3 firewall scoping is # in place. This keeps "units land on disk" and "processes # actually bind ports and load 20+GB into VRAM" as separately # reviewable checkpoints per Ryan's iterative-build preference. # # Two independent units (llama-server-aux.service, # llama-server-toolcall.service) — NOT one unit with two # ExecStarts — so either can be stopped/restarted without # affecting the other (plan §2, §6 rollback requirement). # # The pre-existing Gemma unit (whatever discover.yml found it to # be) is never templated, restarted, or disabled by this file. # ------------------------------------------------------------------------------ - name: Deploy llama-server-aux systemd unit ansible.builtin.template: src: llama-server-aux.service.j2 dest: "/etc/systemd/system/{{ llm_aux_service_name }}.service" owner: root group: root mode: "0644" become: true notify: - reload systemd - restart llama-server-aux - name: Deploy llama-server-toolcall systemd unit ansible.builtin.template: src: llama-server-toolcall.service.j2 dest: "/etc/systemd/system/{{ llm_toolcall_service_name }}.service" owner: root group: root mode: "0644" become: true notify: - reload systemd - restart llama-server-toolcall - name: Flush handlers so daemon-reload lands before any later phase acts on unit state ansible.builtin.meta: flush_handlers # NOTE: no `ansible.builtin.systemd: state: started / enabled: true` task here # on purpose. Units exist on disk after this phase; nothing is running. # The "restart" handlers above only fire (and thus only start anything) if # the template content actually changed AND a later flush_handlers/end-of-play # triggers them — on a first-ever apply this DOES start the services once, # which is expected/acceptable for a fresh deploy, but on any subsequent # re-run with no template changes, nothing restarts. Ryan/verify.yml owns # the deliberate first start + smoke test.