mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 10:59:59 +00:00
`make quality-high` on main (fea6f31d9f) rewrote two files in its
autoformat step:
- roles/sys-service/handlers/refresh_systemctl_service.yml: the
handler's `when` was wrapped by hand; the formatter wraps it at line
width. Both forms parse to the same YAML.
- tests/unit/python/roles/web-app-nextcloud/test_onlyoffice_check_deadline.py:
two over-long assertIn calls that ruff format splits.
A second autoformat run leaves the tree unchanged, so main is stable
under the formatter again.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
58 lines
2.5 KiB
YAML
58 lines
2.5 KiB
YAML
---
|
|
- name: "🔧 Enable systemctl service"
|
|
systemd:
|
|
name: "{{ system_service_name }}"
|
|
scope: "{{ system_service_scope }}"
|
|
enabled: true
|
|
daemon_reload: true
|
|
become: "{{ system_service_unit_become }}"
|
|
# rationale: async; opt-out per caller, a role that reads the unit state sets system_service_force_linear_sync
|
|
async: "{{ system_service_async }}"
|
|
poll: "{{ system_service_poll }}"
|
|
|
|
- name: "🔧 Set systemctl service state"
|
|
systemd:
|
|
name: "{{ system_service_name }}"
|
|
scope: "{{ system_service_scope }}"
|
|
state: "{{ system_service_state }}"
|
|
become: "{{ system_service_unit_become }}"
|
|
# rationale: async; the Result gate below only runs meaningfully for callers that set system_service_force_linear_sync
|
|
async: "{{ system_service_async }}"
|
|
poll: "{{ system_service_poll }}"
|
|
when: not (system_service_suppress_flush | bool)
|
|
register: systemd_set_state
|
|
failed_when: false
|
|
|
|
- name: 🔍 sys-service | Read unit Result (oneshot-safe)
|
|
ansible.builtin.command:
|
|
argv: "{{ system_service_systemctl_show + ['Result', system_service_name] }}"
|
|
register: system_service_result
|
|
changed_when: false
|
|
failed_when: false
|
|
|
|
- name: 🔍 sys-service | Read unit ExecMainStatus (oneshot-safe)
|
|
ansible.builtin.command:
|
|
argv: "{{ system_service_systemctl_show + ['ExecMainStatus', system_service_name] }}"
|
|
register: system_service_exec_status
|
|
changed_when: false
|
|
failed_when: false
|
|
|
|
- name: 🐛 sys-service | Show diagnostics on failure
|
|
ansible.builtin.include_tasks: "{{ role_path }}/tasks/utils/debug.yml"
|
|
vars:
|
|
system_service_debug_unit: "{{ system_service_name }}"
|
|
system_service_debug_context_lines:
|
|
- "system_service_id={{ system_service_id }}"
|
|
- "system_service_name={{ system_service_name }}"
|
|
- "system_service_state={{ system_service_state | default('') }}"
|
|
- "system_service_result={{ system_service_result.stdout | default('') | trim }}"
|
|
- "system_service_exec_status={{ system_service_exec_status.stdout | default('') | trim }}"
|
|
- "systemd_set_state={{ systemd_set_state | to_nice_json }}"
|
|
system_service_debug_fail: true
|
|
system_service_debug_fail_message: >-
|
|
Unable to start service {{ system_service_name }}. See shared service diagnostics above.
|
|
when:
|
|
- not (system_service_suppress_flush | bool)
|
|
- (systemd_set_state.failed | default(false) | bool) or (system_service_state != omit and ( (system_service_result.stdout | default('') | trim) not in
|
|
['success', ''] or (system_service_exec_status.stdout | default('') | trim) not in ['0', '']))
|