관리-도구
편집 파일: local.cpython-39.pyc
a �)g; � @ s� d dl mZmZmZ eZdZd dlZd dlZd dl Z d dl Z d dlZd dlZd dl mZ d dlmZmZ d dlmZ d dlmZmZ d dlmZmZmZ d dlmZ d d lmZ d d l m!Z! e� Z"G dd� de�Z#dS ) � )�absolute_import�division�print_functiona� name: local short_description: execute on controller description: - This connection plugin allows ansible to execute tasks on the Ansible 'controller' instead of on a remote host. author: ansible (@core) version_added: historical extends_documentation_fragment: - connection_pipelining notes: - The remote user is ignored, the user with which the ansible CLI was executed is used instead. N)�AnsibleError�AnsibleFileNotFound)� selectors)� text_type�binary_type)�to_bytes� to_native�to_text)�ConnectionBase)�Display)�unfrackpathc s^ e Zd ZdZdZdZ� fdd�Zdd� Zd� fd d � Z� fdd�Z � fd d�Z dd� Z� ZS )� Connectionz Local based connections �localTc sZ t t| �j|i |�� d | _zt�� | _W n* tyT t� dt �� � d| _Y n0 d S )NzPCurrent user (uid=%s) does not seem to exist on this system, leaving user empty.� )�superr �__init__�cwd�getpassZgetuser�default_user�KeyError�displayZvv�os�getuid)�self�args�kwargs�� __class__� �D/usr/lib/python3.9/site-packages/ansible/plugins/connection/local.pyr . s zConnection.__init__c C s6 | j | j_| js2tjd�| jj�| jjd� d| _| S )z/ connect to the local host; nothing to do here z(ESTABLISH LOCAL CONNECTION FOR USER: {0}��hostT)r � _play_contextZremote_user� _connectedr �vvv�format�remote_addr�r r! r! r"