blob: ade3da69cecfd6d60322da568a606f93ec89bea6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
- name: Start quadlet
ansible.builtin.systemd_service:
name: "{{ item.name }}"
state: "started"
scope: "user"
loop_control:
label: "{{ item.name}}.service"
loop: "{{ containers_quadlets }}"
- name: Check for quadlet not in active or activating state
ansible.builtin.shell: "systemctl --user is-active {{ item.name }}.service"
loop_control:
label: "{{ item.name}}.service: {{ quadlet_status.stdout }}"
loop: "{{ containers_quadlets }}"
register: quadlet_status
failed_when: quadlet_status.stdout not in ['active', 'activating']
- name: Wait for quadlet state to go active
ansible.builtin.shell: "systemctl --user is-active {{ item.name }}.service"
loop_control:
label: "{{ item.name}}.service: {{ quadlet_status.stdout }}"
loop: "{{ containers_quadlets }}"
register: quadlet_status
until: quadlet_status.stdout == 'active'
delay: 2
retries: 25
|