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/plugins/lookup/__pycache__/ |
Upload File : |
� ���c � �� � d dl mZmZmZ eZdZdZdZd dl m c mZ d dl mZ d dlmZmZmZ d dlmZ d d lmZ d d lmZ d dlmZ G d� d e� � Zd� Zd� Z G d� de� � ZdS )� )�absolute_import�division�print_functiona� name: config author: Ansible Core Team version_added: "2.5" short_description: Lookup current Ansible configuration values description: - Retrieves the value of an Ansible configuration setting. - You can use C(ansible-config list) to see all available settings. options: _terms: description: The key(s) to look up required: True on_missing: description: - action to take if term is missing from config - Error will raise a fatal error - Skip will just ignore the term - Warn will skip over it but issue a warning default: error type: string choices: ['error', 'skip', 'warn'] plugin_type: description: the type of the plugin referenced by 'plugin_name' option. choices: ['become', 'cache', 'callback', 'cliconf', 'connection', 'httpapi', 'inventory', 'lookup', 'netconf', 'shell', 'vars'] type: string version_added: '2.12' plugin_name: description: name of the plugin for which you want to retrieve configuration settings. type: string version_added: '2.12' a - name: Show configured default become user ansible.builtin.debug: msg="{{ lookup('ansible.builtin.config', 'DEFAULT_BECOME_USER')}}" - name: print out role paths ansible.builtin.debug: msg: "These are the configured role paths: {{lookup('ansible.builtin.config', 'DEFAULT_ROLES_PATH')}}" - name: find retry files, skip if missing that key ansible.builtin.find: paths: "{{lookup('ansible.builtin.config', 'RETRY_FILES_SAVE_PATH')|default(playbook_dir, True)}}" patterns: "*.retry" - name: see the colors ansible.builtin.debug: msg="{{item}}" loop: "{{lookup('ansible.builtin.config', 'COLOR_OK', 'COLOR_CHANGED', 'COLOR_SKIP', wantlist=True)}}" - name: skip if bad value in var ansible.builtin.debug: msg="{{ lookup('ansible.builtin.config', config_in_var, on_missing='skip')}}" var: config_in_var: UNKNOWN - name: show remote user and port for ssh connection ansible.builtin.debug: msg={{q("ansible.builtin.config", "remote_user", "port", plugin_type="connection", plugin_name="ssh", on_missing='skip')}} - name: show remote_tmp setting for shell (sh) plugin ansible.builtin.debug: msg={{q("ansible.builtin.config", "remote_tmp", plugin_type="shell", plugin_name="sh")}} zM _raw: description: - value(s) of the key(s) in the config type: raw N)� constants)�AnsibleError�AnsibleLookupError�AnsibleOptionsError)� to_native)�string_types)� LookupBase)�Sentinelc � � e Zd ZdS )�MissingSettingN)�__name__� __module__�__qualname__� � �B/usr/lib/python3.11/site-packages/ansible/plugins/lookup/config.pyr r T s � � � � � ��Dr r c �l � t t d|z � � }|� | d�� � }|�t d|�d| �d�� � �t j � |||j |�� � }nB# t $ r � t $ r+}t |� � }d|v rt ||� � � �|�d }~ww xY w|S ) Nz %s_loaderT)� class_onlyzUnable to load z plugin "�")�plugin_type�plugin_name� variableszwas not defined��orig_exc)�getattr� plugin_loader�getr �C�config�get_config_value� _load_namer r r ) �pname�ptyper"