Playbook to enable systemd service

This commit is contained in:
2023-11-26 04:43:38 +05:30
parent 6a55d29500
commit fb01638dec

View File

@@ -0,0 +1,16 @@
---
- hosts: all
become: true
vars_prompt:
- name: service
prompt: "Name of service to be started and enabled"
private: no
tasks:
- name: Enable a service
systemd:
name: "{{ service }}"
enabled: yes
- name: Start a service
systemd:
name: "{{ service }}"
state: started