Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/python3.11/site-packages/ansible/modules/__pycache__/ |
Upload File : |
� ���cF � � � d dl mZmZmZ eZdZdZdZd dl Z d dl mZmZ d dl mZmZ d dlmZ d d lmZ d d lmZmZmZ d dlmZmZmZ G d� d e� � Z G d� de� � Z G d� de� � Z G d� de� � Z G d� de� � Z G d� de� � Z! G d� de� � Z"d� Z#e$dk r e#� � dS dS )� )�absolute_import�division�print_functiona� module: package_facts short_description: Package information as facts description: - Return information about installed packages as facts. options: manager: description: - The package manager used by the system so we can query the package information. - Since 2.8 this is a list and can support multiple package managers per system. - The 'portage' and 'pkg' options were added in version 2.8. - The 'apk' option was added in version 2.11. - The 'pkg_info' option was added in version 2.13. default: ['auto'] choices: ['auto', 'rpm', 'apt', 'portage', 'pkg', 'pacman', 'apk', 'pkg_info'] type: list elements: str strategy: description: - This option controls how the module queries the package managers on the system. C(first) means it will return only information for the first supported package manager available. C(all) will return information for all supported and available package managers on the system. choices: ['first', 'all'] default: 'first' type: str version_added: "2.8" version_added: "2.5" requirements: - For 'portage' support it requires the C(qlist) utility, which is part of 'app-portage/portage-utils'. - For Debian-based systems C(python-apt) package must be installed on targeted hosts. author: - Matthew Jones (@matburt) - Brian Coca (@bcoca) - Adam Miller (@maxamillion) 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 a� - name: Gather the package facts ansible.builtin.package_facts: manager: auto - name: Print the package facts ansible.builtin.debug: var: ansible_facts.packages - name: Check whether a package called foobar is installed ansible.builtin.debug: msg: "{{ ansible_facts.packages['foobar'] | length }} versions of foobar are installed!" when: "'foobar' in ansible_facts.packages" a� ansible_facts: description: Facts to add to ansible_facts. returned: always type: complex contains: packages: description: - Maps the package name to a non-empty list of dicts with package information. - Every dict in the list corresponds to one installed version of the package. - The fields described below are present for all package managers. Depending on the package manager, there might be more fields for a package. returned: when operating system level package manager is specified or auto detected manager type: dict contains: name: description: The package's name. returned: always type: str version: description: The package's version. returned: always type: str source: description: Where information on the package came from. returned: always type: str sample: |- { "packages": { "kernel": [ { "name": "kernel", "source": "rpm", "version": "3.10.0", ... }, { "name": "kernel", "source": "rpm", "version": "3.10.0", ... }, ... ], "kernel-tools": [ { "name": "kernel-tools", "source": "rpm", "version": "3.10.0", ... } ], ... } } # Sample rpm { "packages": { "kernel": [ { "arch": "x86_64", "epoch": null, "name": "kernel", "release": "514.26.2.el7", "source": "rpm", "version": "3.10.0" }, { "arch": "x86_64", "epoch": null, "name": "kernel", "release": "514.16.1.el7", "source": "rpm", "version": "3.10.0" }, { "arch": "x86_64", "epoch": null, "name": "kernel", "release": "514.10.2.el7", "source": "rpm", "version": "3.10.0" }, { "arch": "x86_64", "epoch": null, "name": "kernel", "release": "514.21.1.el7", "source": "rpm", "version": "3.10.0" }, { "arch": "x86_64", "epoch": null, "name": "kernel", "release": "693.2.2.el7", "source": "rpm", "version": "3.10.0" } ], "kernel-tools": [ { "arch": "x86_64", "epoch": null, "name": "kernel-tools", "release": "693.2.2.el7", "source": "rpm", "version": "3.10.0" } ], "kernel-tools-libs": [ { "arch": "x86_64", "epoch": null, "name": "kernel-tools-libs", "release": "693.2.2.el7", "source": "rpm", "version": "3.10.0" } ], } } # Sample deb { "packages": { "libbz2-1.0": [ { "version": "1.0.6-5", "source": "apt", "arch": "amd64", "name": "libbz2-1.0" } ], "patch": [ { "version": "2.7.1-4ubuntu1", "source": "apt", "arch": "amd64", "name": "patch" } ], } } # Sample pkg_info { "packages": { "curl": [ { "name": "curl", "source": "pkg_info", "version": "7.79.0" } ], "intel-firmware": [ { "name": "intel-firmware", "source": "pkg_info", "version": "20210608v0" } ], } } N)� to_native�to_text)� AnsibleModule�missing_required_lib)�get_best_parsable_locale)�get_bin_path)� has_respawned�probe_interpreters_for_module�respawn_module)�LibMgr�CLIMgr�get_all_pkg_managersc �. � � e Zd ZdZd� Zd� Z� fd�Z� xZS )�RPM�rpmc �X � | j � � � � � � S �N)�_lib�TransactionSet�dbMatch��selfs �B/usr/lib/python3.11/site-packages/ansible/modules/package_facts.py�list_installedzRPM.list_installed� s"