Member-only story
Start and enable services on boot Linux on remote hosts — Ansible module service_facts , service
How to list the available Linux services and automate the start and enable service on boot process with Ansible playbook. Included code and demo with chronyd.service
NTP server on a RedHat Enterprise Linux 8.
6 min readNov 29, 2021
How to enable services on boot on remote hosts with Ansible?
I’m going to show you a live demo with some simple Ansible code.
I’m Luca Berton and welcome to today’s episode of Ansible Pilot.
Ansible enable services on boot on remote hosts
- ansible.builtin.service_facts
- Return service state information as fact data
- ansible.builtin.service
- Manage services
Today we’re talking about Ansible modules service_facts and service.
First, you need to acquire the information of the services on the target machine.
This task is performed by the Ansible module service_facts
. You can’t enable a service that doesn’t exist, can you…