관리-도구
편집 파일: service_facts.cpython-39.opt-1.pyc
a �)g�B � @ s� d dl mZmZmZ eZdZdZdZd dl Z d dl Z d dlZd dlm Z d dlmZ G dd � d e�ZG d d� de�ZG dd � d e�ZG dd� de�ZG dd� de�Zdd� Zedkr�e� dS )� )�absolute_import�division�print_functionak --- module: service_facts short_description: Return service state information as fact data description: - Return service state information as fact data for various service management utilities. version_added: "2.5" requirements: ["Any of the following supported init systems: systemd, sysv, upstart, openrc, AIX SRC"] extends_documentation_fragment: - action_common_attributes - action_common_attributes.facts attributes: check_mode: support: full diff_mode: support: none facts: support: full platform: platforms: posix notes: - When accessing the C(ansible_facts.services) facts collected by this module, it is recommended to not use "dot notation" because services can have a C(-) character in their name which would result in invalid "dot notation", such as C(ansible_facts.services.zuul-gateway). It is instead recommended to using the string value of the service name as the key in order to obtain the fact data value like C(ansible_facts.services['zuul-gateway']) - AIX SRC was added in version 2.11. author: - Adam Miller (@maxamillion) z� - name: Populate service facts ansible.builtin.service_facts: - name: Print service facts ansible.builtin.debug: var: ansible_facts.services a ansible_facts: description: Facts to add to ansible_facts about the services on the system returned: always type: complex contains: services: description: States of the services with service name as key. returned: always type: complex contains: source: description: - Init system of the service. - One of C(rcctl), C(systemd), C(sysv), C(upstart), C(src). returned: always type: str sample: sysv state: description: - State of the service. - 'This commonly includes (but is not limited to) the following: C(failed), C(running), C(stopped) or C(unknown).' - Depending on the used init system additional states might be returned. returned: always type: str sample: running status: description: - State of the service. - Either C(enabled), C(disabled), C(static), C(indirect) or C(unknown). returned: systemd systems or RedHat/SUSE flavored sysvinit/upstart or OpenBSD type: str sample: enabled name: description: Name of the service. returned: always type: str sample: arp-ethers.service N)� AnsibleModule)�get_best_parsable_localec @ s e Zd Zdd� ZdS )�BaseServicec C s || _ d S )N)�module)�selfr � r �A/usr/lib/python3.9/site-packages/ansible/modules/service_facts.py�__init__e s zBaseService.__init__N)�__name__� __module__�__qualname__r r r r r r c s r c @ s4 e Zd Zdd� Zdd� Zdd� Zdd� Zd d � ZdS )�ServiceScanServicec C s� | j �d| j �\}}}|dkr0tj�d�s0d S |dkrL| j �d||f � tjdtj d�}|� |�D ]6}|�d�}|�d �d kr�d}nd}||d d�||<