ansible.builtin.service_facts (v2.5.10) — module

Return service state information as fact data

| "added in version" 2.5 of ansible.builtin"

Authors: Matthew Jones, Adam Miller (@maxamillion)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.5.10

Description

Return service state information as fact data for various service management utilities


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: populate service facts
  service_facts:
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- debug:
    var: ansible_facts.services

Outputs

ansible_facts:
  contains:
    services:
      arp-ethers.service:
        name: arp-ethers.service
        source: systemd
        state: stopped
      network:
        name: network
        source: sysv
        state: running
  description: facts to add to ansible_facts about the services on the system
  returned: always
  type: complex