pez-infra/ansible/roles/systemd_services/tasks/main.yml
Rasmus Wejlgaard 89b21fd6fc fix: stop masking failed service deploys; trim dead config
The docker_services and systemd_services roles ran their "start the
service" tasks with `failed_when: false`, so a container or unit that
failed to come up still reported the deploy as green. Drop it from both
start tasks so a broken deploy actually fails CI. The compose/unit *copy*
tasks keep `failed_when: false` — that's load-bearing for the
`item is not failed` filter that skips services without a compose/unit file.

Also:
- Remove a duplicate "Template service .env files" task in docker_services
  (second copy used a hardcoded path and didn't register; first one is the
  one the start task reads).
- Don't trigger a full fleet deploy on docs/markdown/workflow-only pushes
  to main — add docs/**, **/*.md and .github/** to paths-ignore.
- Drop the dangling `update-freebsd` Make target (playbook doesn't exist;
  fleet has no FreeBSD hosts).
2026-06-04 18:37:37 +01:00

21 lines
673 B
YAML

---
# Deploy custom systemd unit files from the repo.
# Looks for unit files in services/<name>/<name>.service
- name: Copy systemd unit files
ansible.builtin.copy:
src: "{{ playbook_dir }}/services/{{ item }}/{{ item }}.service"
dest: "/etc/systemd/system/{{ item }}.service"
mode: '0644'
loop: "{{ systemd_services | default([]) }}"
register: systemd_services_unit_files
failed_when: false
notify: Reload systemd daemon
- name: Enable and start systemd services
ansible.builtin.systemd:
name: "{{ item.item }}"
state: started
enabled: true
loop: "{{ systemd_services_unit_files.results | default([]) }}"
when: item is not failed