mirror of
https://github.com/dredx/prole.git
synced 2026-09-27 06:44:29 +00:00
22 lines
669 B
YAML
22 lines
669 B
YAML
---
|
|
- name: Gather service facts
|
|
ansible.builtin.service_facts:
|
|
|
|
- name: Require k3s-agent service to exist
|
|
ansible.builtin.assert:
|
|
that:
|
|
- ('k3s-agent' + '.service') in ansible_facts.services
|
|
- ansible_facts.services['k3s-agent' + '.service'].status != 'not-found'
|
|
fail_msg: "k3s-agent service is not installed on {{ inventory_hostname }}."
|
|
when: not ansible_check_mode
|
|
|
|
- name: Start k3s-agent
|
|
ansible.builtin.systemd:
|
|
name: k3s-agent
|
|
state: started
|
|
enabled: true
|
|
no_block: true
|
|
when:
|
|
- ('k3s-agent' + '.service') in ansible_facts.services
|
|
- ansible_facts.services['k3s-agent' + '.service'].status != 'not-found'
|