403Webshell
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 :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /lib/python3.11/site-packages/ansible/modules/__pycache__/copy.cpython-311.pyc
�

���c����6�ddlmZmZmZeZdZdZdZddl	Z	ddl
Z
ddlZddlZddl
ZddlZddlZddlZddlZddlZddlZddlmZmZddlmZddlmZdd	lmZdd
lmZdaGd�de ��Z!d
�Z"d�Z#d�Z$d�Z%d�Z&d�Z'd�Z(d�Z)e*dkre)��dSdS)�)�absolute_import�division�print_functionaj
---
module: copy
version_added: historical
short_description: Copy files to remote locations
description:
    - The C(copy) module copies a file from the local or remote machine to a location on the remote machine.
    - Use the M(ansible.builtin.fetch) module to copy files from remote locations to the local box.
    - If you need variable interpolation in copied files, use the M(ansible.builtin.template) module.
      Using a variable in the C(content) field will result in unpredictable output.
    - For Windows targets, use the M(ansible.windows.win_copy) module instead.
options:
  src:
    description:
    - Local path to a file to copy to the remote server.
    - This can be absolute or relative.
    - If path is a directory, it is copied recursively. In this case, if path ends
      with "/", only inside contents of that directory are copied to destination.
      Otherwise, if it does not end with "/", the directory itself with all contents
      is copied. This behavior is similar to the C(rsync) command line tool.
    type: path
  content:
    description:
    - When used instead of C(src), sets the contents of a file directly to the specified value.
    - Works only when C(dest) is a file. Creates the file if it does not exist.
    - For advanced formatting or if C(content) contains a variable, use the
      M(ansible.builtin.template) module.
    type: str
    version_added: '1.1'
  dest:
    description:
    - Remote absolute path where the file should be copied to.
    - If C(src) is a directory, this must be a directory too.
    - If C(dest) is a non-existent path and if either C(dest) ends with "/" or C(src) is a directory, C(dest) is created.
    - If I(dest) is a relative path, the starting directory is determined by the remote host.
    - If C(src) and C(dest) are files, the parent directory of C(dest) is not created and the task fails if it does not already exist.
    type: path
    required: yes
  backup:
    description:
    - Create a backup file including the timestamp information so you can get the original file back if you somehow clobbered it incorrectly.
    type: bool
    default: no
    version_added: '0.7'
  force:
    description:
    - Influence whether the remote file must always be replaced.
    - If C(true), the remote file will be replaced when contents are different than the source.
    - If C(false), the file will only be transferred if the destination does not exist.
    type: bool
    default: yes
    version_added: '1.1'
  mode:
    description:
    - The permissions of the destination file or directory.
    - For those used to C(/usr/bin/chmod) remember that modes are actually octal numbers.
      You must either add a leading zero so that Ansible's YAML parser knows it is an octal number
      (like C(0644) or C(01777)) or quote it (like C('644') or C('1777')) so Ansible receives a string
      and can do its own conversion from string into number. Giving Ansible a number without following
      one of these rules will end up with a decimal number which will have unexpected results.
    - As of Ansible 1.8, the mode may be specified as a symbolic mode (for example, C(u+rwx) or C(u=rw,g=r,o=r)).
    - As of Ansible 2.3, the mode may also be the special string C(preserve).
    - C(preserve) means that the file will be given the same permissions as the source file.
    - When doing a recursive copy, see also C(directory_mode).
    - If C(mode) is not specified and the destination file B(does not) exist, the default C(umask) on the system will be used
      when setting the mode for the newly created file.
    - If C(mode) is not specified and the destination file B(does) exist, the mode of the existing file will be used.
    - Specifying C(mode) is the best way to ensure files are created with the correct permissions.
      See CVE-2020-1736 for further details.
  directory_mode:
    description:
    - When doing a recursive copy set the mode for the directories.
    - If this is not set we will use the system defaults.
    - The mode is only set on directories which are newly created, and will not affect those that already existed.
    type: raw
    version_added: '1.5'
  remote_src:
    description:
    - Influence whether C(src) needs to be transferred or already is present remotely.
    - If C(false), it will search for C(src) on the controller node.
    - If C(true) it will search for C(src) on the managed (remote) node.
    - C(remote_src) supports recursive copying as of version 2.8.
    - C(remote_src) only works with C(mode=preserve) as of version 2.6.
    - Autodecryption of files does not work when C(remote_src=yes).
    type: bool
    default: no
    version_added: '2.0'
  follow:
    description:
    - This flag indicates that filesystem links in the destination, if they exist, should be followed.
    type: bool
    default: no
    version_added: '1.8'
  local_follow:
    description:
    - This flag indicates that filesystem links in the source tree, if they exist, should be followed.
    type: bool
    default: yes
    version_added: '2.4'
  checksum:
    description:
    - SHA1 checksum of the file being transferred.
    - Used to validate that the copy of the file was successful.
    - If this is not provided, ansible will use the local calculated checksum of the src file.
    type: str
    version_added: '2.5'
extends_documentation_fragment:
    - decrypt
    - files
    - validate
    - action_common_attributes
    - action_common_attributes.files
    - action_common_attributes.flow
notes:
    - The M(ansible.builtin.copy) module recursively copy facility does not scale to lots (>hundreds) of files.
seealso:
    - module: ansible.builtin.assemble
    - module: ansible.builtin.fetch
    - module: ansible.builtin.file
    - module: ansible.builtin.template
    - module: ansible.posix.synchronize
    - module: ansible.windows.win_copy
author:
    - Ansible Core Team
    - Michael DeHaan
attributes:
  action:
    support: full
  async:
    support: none
  bypass_host_loop:
    support: none
  check_mode:
    support: full
  diff_mode:
    support: full
  platform:
    platforms: posix
  safe_file_operations:
      support: full
  vault:
    support: full
    version_added: '2.2'
a�
- name: Copy file with owner and permissions
  ansible.builtin.copy:
    src: /srv/myfiles/foo.conf
    dest: /etc/foo.conf
    owner: foo
    group: foo
    mode: '0644'

- name: Copy file with owner and permission, using symbolic representation
  ansible.builtin.copy:
    src: /srv/myfiles/foo.conf
    dest: /etc/foo.conf
    owner: foo
    group: foo
    mode: u=rw,g=r,o=r

- name: Another symbolic mode example, adding some permissions and removing others
  ansible.builtin.copy:
    src: /srv/myfiles/foo.conf
    dest: /etc/foo.conf
    owner: foo
    group: foo
    mode: u+rw,g-wx,o-rwx

- name: Copy a new "ntp.conf" file into place, backing up the original if it differs from the copied version
  ansible.builtin.copy:
    src: /mine/ntp.conf
    dest: /etc/ntp.conf
    owner: root
    group: root
    mode: '0644'
    backup: yes

- name: Copy a new "sudoers" file into place, after passing validation with visudo
  ansible.builtin.copy:
    src: /mine/sudoers
    dest: /etc/sudoers
    validate: /usr/sbin/visudo -csf %s

- name: Copy a "sudoers" file on the remote machine for editing
  ansible.builtin.copy:
    src: /etc/sudoers
    dest: /etc/sudoers.edit
    remote_src: yes
    validate: /usr/sbin/visudo -csf %s

- name: Copy using inline content
  ansible.builtin.copy:
    content: '# This file was moved to /etc/other.conf'
    dest: /etc/mine.conf

- name: If follow=yes, /path/to/file will be overwritten by contents of foo.conf
  ansible.builtin.copy:
    src: /etc/foo.conf
    dest: /path/to/link  # link to /path/to/file
    follow: yes

- name: If follow=no, /path/to/link will become a file and be overwritten by contents of foo.conf
  ansible.builtin.copy:
    src: /etc/foo.conf
    dest: /path/to/link  # link to /path/to/file
    follow: no
a;
dest:
    description: Destination file/path.
    returned: success
    type: str
    sample: /path/to/file.txt
src:
    description: Source file used for the copy on the target machine.
    returned: changed
    type: str
    sample: /home/httpd/.ansible/tmp/ansible-tmp-1423796390.97-147729857856000/source
md5sum:
    description: MD5 checksum of the file after running copy.
    returned: when supported
    type: str
    sample: 2a5aeecc61dc98c4d780b14b330e3282
checksum:
    description: SHA1 checksum of the file after running copy.
    returned: success
    type: str
    sample: 6e642bb8dd5c2e027bf21dd923337cbb4214f827
backup_file:
    description: Name of backup file created.
    returned: changed and if backup=yes
    type: str
    sample: /path/to/file.txt.2015-02-12@22:09~
gid:
    description: Group id of the file, after execution.
    returned: success
    type: int
    sample: 100
group:
    description: Group of the file, after execution.
    returned: success
    type: str
    sample: httpd
owner:
    description: Owner of the file, after execution.
    returned: success
    type: str
    sample: httpd
uid:
    description: Owner id of the file, after execution.
    returned: success
    type: int
    sample: 100
mode:
    description: Permissions of the target, after execution.
    returned: success
    type: str
    sample: "0644"
size:
    description: Size of the target, after execution.
    returned: success
    type: int
    sample: 1220
state:
    description: State of the target, after execution.
    returned: success
    type: str
    sample: file
N)�to_bytes�	to_native)�
AnsibleModule)�get_bin_path)�get_best_parsable_locale)�PY3c��eZdZd�ZdS)�AnsibleModuleErrorc��||_dS)N��results)�selfrs  �9/usr/lib/python3.11/site-packages/ansible/modules/copy.py�__init__zAnsibleModuleError.__init__4s
�������N)�__name__�
__module__�__qualname__r�rrr
r
3s#����������rr
c�H�td��}|d|g}d�|D��}tt��}t�|t	|||������\}}}|dkr7td�d�|��||�����dS)	N�setfaclz-bc�,�g|]}t|����Sr)r)�.0�xs  r�
<listcomp>zclear_facls.<locals>.<listcomp>@s��6�6�6�Q�X�a�[�[�6�6�6r)�LANG�LC_ALL�LC_MESSAGES)�environ_updaterz1Error running "{0}": stdout: "{1}"; stderr: "{2}"� )r	r
�module�run_command�dict�RuntimeError�format�join)�pathr�acl_command�
b_acl_command�locale�rc�out�errs        r�clear_faclsr1<s����9�%�%�G��D�$�'�K�6�6�+�6�6�6�M�
%�f�
-�
-�F��%�%�m�D�f�]c�qw�Dx�Dx�Dx�%�y�y�L�B��S�	�Q�w�w��N�U�U�VY�V^�V^�_l�Vm�Vm�or�tw�x�x�y�y�y��wrc�N�tj�|��\}}t|d���}|dkrd|gfStj�|��s+|dkrtddi����t
|��\}}n||gfS|�|��||fS)	zi
    Return the first pre-existing directory and a list of the new directories that will be created.
    �surrogate_or_strict��errors��.�/�msgz0The '/' directory doesn't exist on this machine.r)�osr*�splitr�existsr
�split_pre_existing_dir�append)�dirname�head�tail�b_head�pre_existing_dir�new_directory_lists      rr=r=Gs�������w�'�'�J�D�$�
�d�#8�
9�
9�
9�F��r�z�z��d�V�}��
�7�>�>�&�!�!���3�;�;�$�e�5g�-h�i�i�i�i�1G��1M�1M�.�	�-�-��t�f�~�����d�#�#�#��0�1�1rc���|ratj�||�d����}||d<|�||��}t|||||��}|S)z]
    Walk the new directories list and make sure that permissions are as we would expect
    rr*)r:r*r)�pop�set_fs_attributes_if_different�&adjust_recursive_directory_permissions)rCrDr$�directory_args�changed�working_dirs      rrHrHYso��
�{��g�l�l�#3�5G�5K�5K�A�5N�5N�O�O��!,��v���7�7���P�P��8��FX�Z`�bp�ry�z�z���Nrc��
�d}|jd}|jd}|��[|js�tj|��D]\�
}}|��
|d��}|dur|}�
fd�|D��D]}|�||d��}|dur|}� �
fd�|D��D]}	|�|	|d��}|dur|}� ��n�tj|��j}
tj|��D]�\�
}}tj�
��j	|
k}|dur|}�
fd�|D��D]%}tj|��j	|
k}|dur|}�&�
fd�|D��D]%}	tj|	��j	|
k}|dur|}�&��|��[|js�tj|��D]\�
}}|�
�
|d��}|dur|}�
fd	�|D��D]}|�
||d��}|dur|}� �
fd
�|D��D]}	|�
|	|d��}|dur|}� ��n�tj|��j
}tj|��D]�\�
}}tj�
��j|k}|dur|}�
fd�|D��D]%}tj|��j|k}|dur|}�&�
fd�|D��D]%}	tj|	��j|k}|dur|}�&��|S)
NF�owner�groupTc�P��g|]"}tj��|����#Sr�r:r*r)�r�d�dirpaths  �rrz#chown_recursive.<locals>.<listcomp>q�)���G�G�G��B�G�L�L��!�4�4�G�G�Grc�P��g|]"}tj��|����#SrrP�r�frSs  �rrz#chown_recursive.<locals>.<listcomp>u�)���I�I�I�!�R�W�\�\�'�1�5�5�I�I�Irc�P��g|]"}tj��|����#SrrPrQs  �rrz#chown_recursive.<locals>.<listcomp>rTrc�P��g|]"}tj��|����#SrrPrVs  �rrz#chown_recursive.<locals>.<listcomp>�rXrc�P��g|]"}tj��|����#SrrPrQs  �rrz#chown_recursive.<locals>.<listcomp>�rTrc�P��g|]"}tj��|����#SrrPrVs  �rrz#chown_recursive.<locals>.<listcomp>�rXrc�P��g|]"}tj��|����#SrrPrQs  �rrz#chown_recursive.<locals>.<listcomp>�rTrc�P��g|]"}tj��|����#SrrPrVs  �rrz#chown_recursive.<locals>.<listcomp>�rXr)�params�
check_moder:�walk�set_owner_if_different�pwd�getpwnam�pw_uid�stat�st_uid�set_group_if_different�grp�getgrnam�gr_gid�st_gid)r*r$rJrMrN�dirnames�	filenames�
owner_changed�dir�file�uid�
group_changed�gidrSs             @r�chown_recursiverufs�����G��M�'�"�E��M�'�"�E���� �	0�02���
�
�
0�
0�,���9� &� =� =�g�u�e� T� T�
� �D�(�(�+�G�G�G�G�G�h�G�G�G�0�0�C�$*�$A�$A�#�u�e�$T�$T�M�$��,�,�"/���I�I�I�I�y�I�I�I�0�0�D�$*�$A�$A�$��u�$U�$U�M�$��,�,�"/���0�
0��,�u�%�%�,�C�02���
�
�
0�
0�,���9�!#���!1�!1�!8�C�!?�
� �D�(�(�+�G�G�G�G�G�h�G�G�G�0�0�C�%'�W�S�\�\�%8�C�%?�M�$��,�,�"/���I�I�I�I�y�I�I�I�0�0�D�%'�W�T�]�]�%9�S�%@�M�$��,�,�"/���0�
��� �	0�02���
�
�
0�
0�,���9� &� =� =�g�u�e� T� T�
� �D�(�(�+�G�G�G�G�G�h�G�G�G�0�0�C�$*�$A�$A�#�u�e�$T�$T�M�$��,�,�"/���I�I�I�I�y�I�I�I�0�0�D�$*�$A�$A�$��u�$U�$U�M�$��,�,�"/���0�
0��,�u�%�%�,�C�02���
�
�
0�
0�,���9�!#���!1�!1�!8�C�!?�
� �D�(�(�+�G�G�G�G�G�h�G�G�G�0�0�C�%'�W�S�\�\�%8�C�%?�M�$��,�,�"/���I�I�I�I�y�I�I�I�0�0�D�%'�W�T�]�]�%9�S�%@�M�$��,�,�"/���0�
�Nrc���d}|jd}|jd}|jd}tj||��j}t	|��rd}|j�s|D�]}tj�||��}	tj�||��}
t|	d���}t|
d���}tj�
|��r.|dur*t
j|��}
t
j|
|��n*tj||��tj||��|�|�||d��|�|�||d��d}��|S)zKCopy files that are different between `src` directory and `dest` directory.FrMrN�local_followTr3r4)r_�filecmp�dircmp�
diff_files�lenr`r:r*r)r�islink�readlink�symlink�shutil�copyfile�copymoderbrh)�src�destr$rJrMrNrwrz�item�
src_item_path�dest_item_path�b_src_item_path�b_dest_item_path�linktos              r�copy_diff_filesr��su���G��M�'�"�E��M�'�"�E��=��0�L����T�*�*�5�J�
�:����������	�	�D��G�L�L��d�3�3�M��W�\�\�$��5�5�N�&�}�=R�S�S�S�O�'��?T�U�U�U���w�~�~�o�.�.�
C�<�5�3H�3H���_�5�5���
�6�#3�4�4�4�4����1A�B�B�B����1A�B�B�B�� ��-�-�.>��u�M�M�M�� ��-�-�.>��u�M�M�M��G�G��Nrc�&�d}|jd}|jd}|jd}tj||��j}t	|��rd}|j�s4|D�]0}tj�||��}	tj�||��}
t|	d���}t|
d���}tj�
|��rKtj�|��r,|dur(tj
|||���t||��tj�
|��rLtj�|��r-|dur)t
j|��}
t
j|
|��tj�
|��rjtj�|��rK|durGtj||��|�|�||d��|�|�||d��tj�
|��rLtj�|��r-|dur)t
j|��}
t
j|
|��tj�
|��s{tj�|��r\tj||��tj||��|�|�||d��|�|�||d��tj�
|��sGtj�|��r(tj
|||���t||��d}��2|S)	zFCopy files that exist in `src` directory only to the `dest` directory.FrMrNrwTr3r4��symlinks)r_rxry�	left_onlyr{r`r:r*r)rr|�isdirr�copytreerur}r~�isfiler�rbrhr�)r�r�r$rJrMrNrwr�r�r�r�r�r�r�s              r�copy_left_onlyr��sT���G��M�'�"�E��M�'�"�E��=��0�L���s�D�)�)�3�I�
�9�~�~������'��&	�&	�D��G�L�L��d�3�3�M��W�\�\�$��5�5�N�&�}�=R�S�S�S�O�'��?T�U�U�U���w�~�~�o�.�.�
:�2�7�=�=��3Q�3Q�
:�Vb�fj�Vj�Vj����1A�P\�L\�]�]�]�]�� 0�&�9�9�9��w�~�~�o�.�.�
5�2�7�=�=��3Q�3Q�
5�Vb�fk�Vk�Vk���_�5�5���
�6�#3�4�4�4��w�~�~�o�.�.�
R�2�7�>�>�/�3R�3R�
R�Wc�gk�Wk�Wk����1A�B�B�B��$��1�1�2B�E�5�Q�Q�Q��$��1�1�2B�E�5�Q�Q�Q��w�~�~�o�.�.�
5�2�7�>�>�/�3R�3R�
5�Wc�gl�Wl�Wl���_�5�5���
�6�#3�4�4�4��7�>�>�/�2�2�
R�r�w�~�~�o�7V�7V�
R����1A�B�B�B����1A�B�B�B��$��1�1�2B�E�5�Q�Q�Q��$��1�1�2B�E�5�Q�Q�Q��7�>�>�/�2�2�
:�r�w�}�}�_�7U�7U�
:����1A�P\�L\�]�]�]�]�� 0�&�9�9�9��G�G��Nrc��d}tj||��j}|D]�}tj�||��}tj�||��}t
|d���}t
|d���}	t||	|��}
t||	|��}|
s|rd}|pLttj�||��tj�||��|��}��|S)NFr3r4T)
rxry�common_dirsr:r*r)rr�r��copy_common_dirs)r�r�r$rJr�r�r�r�r�r��diff_files_changed�left_only_changeds            rr�r��s����G��.��d�+�+�7�K��i�i������S�$�/�/�
�����d�D�1�1��"�=�9N�O�O�O��#�N�;P�Q�Q�Q��,�_�>N�PV�W�W��*�?�<L�f�U�U���	�!2�	��G��h�-�b�g�l�l�3��.E�.E�r�w�|�|�TX�Z^�G_�G_�ag�h�h����Nrc�x&�tttd���td���tdd���tdd���tdd�	��tdd�	��td���td
���td���td���td���tdd�	�����dd���atjd
}t	|d���}tjd}t
jj|vr%d�t
jj|��}t	|d���}tjd}tjd}tj�	dd��}tj�	dd��}tjd}tjd}	tjd}
tjd}tjd}tjd}
tjd}t
j�
|��st�d|z���tj|t
j
��st�d|z���tjdd kr;d!tjtj|��j��ztjd<tjd}
d}d}d}d}t
j�|��r�	t�|��}nH#t&t(f$r4}t�d"t-|��z��Yd}~nd}~wwxYw	t�|��}n[#t0$rYnOwxYw|
rIt
j�|��s*t�d#t-|��z��|r#||krt�d$||�%��|�t
j���rZ|r t
j�||��}t	|d���}t
j�|��}t	|d���}t
j�
|��s�	t;|��\}}nU#t<$rH}|jd&xxd'�|��z
cc<tjdGi|j ��Yd}~nd}~wwxYwtj!|��t�"tj��}tjd(}|�||d<nd|d<tG||t||��t
j�|��rTt
j�$|��}|r|}t
j�||��}t	|d���}t
j�
|��r�t
j�%|��r2|r0t
j�&|��}t-|d���}|st�'d)||d�*��tj|t
j
��r9t
j�|��rt�|��}�nt
j�
t
j�|����s�	tjt
j�|����nu#t&$rh}d+t-|���(��vr;t�d,t
j�|��z���Yd}~nd}~wwxYwt�d-t
j�|��z���tjt
j�|��t
j)��sMtjd.s;t�d/t
j�|��z���d}||ks t
j�%|���r�tj*�s�	|r9t
j�
|��rt�+|��}t
j�%|��r6tj,|��t[|d0���.��|r�|
�t�/||
d��|�t�0||d��|�t�1||d��d1|vrt�d2|z���t�2||z��\}}}|d3krt�d4|||�5��|}|
r�t
j�|��r�tgj4t
j�|���6��\} }tkj6||��	tkj7||��nn#t&$ra}|j8tpj9krA|
d kr;t�d7�t-|������n�Yd}~nd}~wwxYwttrFtwt
d8��r1	d9tj<|��v}!n#tz$r}d}!Yd}~nd}~wwxYwt�>||tjd.�:��ttr�twt
d8��r{tj@��d;krd|
sb|!r`	t�|��nO#t0$r}d<t-|��vrn�Yd}~n-d}~wt�$r}d=t-|��vrn�Yd}~nd}~wwxYwnJ#t(t&f$r6t�d>|�d?|��t�jD���@��YnwxYwd}nd}|��|��|
�rt
j�tjd
���r�t	tjd
d���}t	tjdd���}|�t
jj��r�t
j�tjd��rat�||t��}"t�||t��}#t�||t��}$t�|t��}%|"s|#s|$s|%rd}|�t
jj���rt
j�
tjd��s�t	t
j�$|��d���}&t	t
j�||&��d���}t	t
j�tjd
dA��d���}tj*stkjI|||	�B��t�|t��d}|�t
jj���s�t
j�tjd���r�t	t
j�$|��d���}&t	t
j�||&��d���}t	t
j�tjd
dA��d���}tj*sNt
j�
|��s/tkjI|||	�B��d}t�|t��tj*r!t
j�
|��sd}t
j�
|��rat�||t��}"t�||t��}#t�||t��}$t�|t��}%|"s|#s|$s|%rd}|�t
jj���s�t
j�
tjd���syt	t
j�$tjd
��d���}&t	t
j�||&��d���}tj*s�t
j�
|��s�tj!|��t	t
j�tjd
dA��d���}t�||t��}"t�||t��}#t�||t��}$t�|t��}%|"s|#s|$s|%rd}tj*r!t
j�
|��sd}t|||||�C��}'|r||'dD<tj*sJt�"tj|�E��}(t�J|(|'dF��|'dF<tj'dGi|'��dS)HNr*)�type�strT)r��no_log)r��required�boolF)r��default�raw)r��_original_basename�contentr��backup�force�validate�directory_mode�
remote_srcrw�checksum�follow)�
argument_spec�add_file_common_args�supports_check_moder�r3r4r�z.{0}{1}r�r�r�r�r�rw�moderMrNr�r�zSource %s not found)r9zSource %s not readable�preservez0%03oz5Unable to calculate src checksum, assuming change: %sz+Cannot copy invalid source '%s': not a filezBCopied file does not match the expected checksum. Transfer failed.)r9r��expected_checksumr9z Could not copy to {0}r�zfile already exists)r9r�r�rJzpermission deniedz*Destination directory %s is not accessiblez'Destination directory %s does not exist�
unsafe_writeszDestination %s not writable�wz%szvalidate must contain %%s: %srzfailed to validate)r9�exit_status�stdout�stderr)rpzUnable to copy stats {0}�	listxattrzsystem.posix_acl_access)r��LinuxrzOperation not supportedzfailed to copy: z to )r9�	tracebackr6r�)r�r��md5sumr�rJ�backup_file)r*rJr)Krr&r$r_rr:r*�sepr(�getr<�	fail_json�access�R_OKrf�S_IMODE�st_moder��sha1�OSError�IOError�warnr�md5�
ValueErrorr��endswithr)r?r=r
�resultr�makedirs�load_file_common_argumentsrH�basenamer|�realpath�	exit_json�lower�W_OKr`�backup_local�unlink�open�close�set_mode_if_differentrbrhr%�tempfile�mkstemprr��copystat�errno�ENOSYSr�hasattrr��	Exception�atomic_move�platform�systemr1r'r��
format_excr�r�r�rur�rG))r��b_srcr��b_destr�r�r�r�r�rwr�rMrNr�r�rJ�
checksum_dest�checksum_src�
md5sum_src�er?�	b_dirnamerCrDrIr�r�r�r.r/r0�b_mysrc�_�src_has_aclsr�r��common_dirs_changed�owner_group_changed�
b_basename�res_args�	file_argss)                                         r�mainr�
s������&�!�!�!�#��/�/�/��e�D�1�1�1��6�D�1�1�1��V�U�3�3�3��F�D�1�1�1��u�%�%�%��U�+�+�+���(�(�(��6�*�*�*��u�%�%�%��V�U�3�3�3�

�

�

�"� �#���F�(�-��
�C��S�!6�7�7�7�E��=�� �D�	�w�{�$���������T�2�2��
�d�#8�
9�
9�
9�F�
�]�8�
$�F��M�'�"�E���*�*�+?��F�F���}� � ��T�2�2�H�
�]�8�
$�F��=��0�L��=�� �D��M�'�"�E��M�'�"�E���|�,�J��}�Z�(�H�
�7�>�>�%� � �<����2�c�:��;�;�;�
�9�U�B�G�$�$�?����5��=��>�>�>��}�V��
�*�*� '�$�,�r�w�u�~�~�7M�*N�*N� N��
�f���=�� �D��G��M��L��J�	�w�~�~�c���Y�	`�!�;�;�s�+�+�L�L����!�	`�	`�	`��K�K�O�R[�\]�R^�R^�^�_�_�_�_�_�_�_�_�����	`����	����C���J�J���	�	�	��D�	����	�Y�B�G�M�M�#�.�.�Y����F��SV���W�X�X�X��
�L�H�,�,����T�!�&�	�	
�	
�	
��}�}�R�V���z��	:��7�<�<��&8�9�9�D��$�'<�=�=�=���'�/�/�$�'�'���W�-B�C�C�C�	��w�~�~�i�(�(�	z�
.�9O�PW�9X�9X�6�!�#5�#5��%�
.�
.�
.�������#;�#B�#B�4�#H�#H�H����� �-�-�1�9�-�-�-�-�-�-�-�-�����
.����
�K�	�"�"�"�#�>�>�v�}�M�M�N�#�]�+;�<�N��)�)7��v�&�&�)-��v�&�2�3C�EW�Y_�ao�qx�y�y�y�	�w�}�}�V���>��7�#�#�C�(�(���	*�)�H��w�|�|�D�(�+�+���$�'<�=�=�=��	�w�~�~�f���f�
�7�>�>�&�!�!�	C�f�	C��W�%�%�f�-�-�F��V�,A�B�B�B�D��	[����!6�C�d�TY��Z�Z�Z�
�9�V�R�W�%�%�	.�"�'�.�.��*@�*@�	.�"�K�K��-�-�M���w�~�~�b�g�o�o�f�5�5�6�6�
	f�
q�
�������/�/�0�0�0�0���
q�
q�
q�&�)�A�,�,�*<�*<�*>�*>�>�>��$�$�)U�Y[�Y`�Yh�Yh�im�Yn�Yn�)o�$�p�p�p����������
q����
���!J�b�g�o�o�^b�Nc�Nc�!d��e�e�e�
�9�R�W�_�_�V�,�,�b�g�6�6�V�v�}�_�?]�V����:�b�g�o�o�d�>S�>S�T��U�U�U��K��}�$�$�����v�(>�(>�$�� �X	q�W
q��@��w�~�~�f�-�-�@�&,�&9�&9�$�&?�&?���7�>�>�&�)�)�.��I�f�%�%�%����%�%�+�+�-�-�-��
k��'��4�4�S�$��F�F�F��(��5�5�c�5�%�H�H�H��(��5�5�c�5�%�H�H�H��8�+�+��(�(�-L�PX�-Y�(�Z�Z�Z�%+�%7�%7��3��%G�%G�N�R��c��Q�w�w��(�(�-A�r�Z]�fi�(�j�j�j����"�"�'�.�.��"7�"7�"�!)�!1�b�g�o�o�f�6M�6M�!N�!N�!N�J�A�w��O�E�7�3�3�3�"����w�7�7�7�7��"�"�"�"��9���4�4���9K�9K�"�K�K�(B�(I�(I�)�TY�JZ�JZ�([�([�\�\�\�\�!�]�\�\�\�\�����"�����,�7�2�{�3�3�,�,�'@�B�L�QT�DU�DU�'U����$�,�,�,�'+�����������,����
�"�"�7�D��
�o�@^�"�_�_�_��$&�7�2�{�3�3�$&���8I�8I�W�8T�8T�]g�8T� $�&�
&�'��-�-�-�-��)�&�&�&�(�I�a�L�L�8�8�!%� %�!%��������� ,�&�&�&�8�I�a�L�L�H�H� $� %�!%���������	&�������W�%�
q�
q�
q�� � � �3�3�3���%M�Yb�Ym�Yo�Yo� �p�p�p�p�p�
q�����������
� 5��4	#�"�'�-�-��
�e�(<�=�=�4	#��V�]�5�1�:O�P�P�P�E��f�m�F�3�<Q�R�R�R�F��|�|�B�G�K�(�(�
#�R�W�]�]�6�=��;P�-Q�-Q�
#�%4�U�F�F�%K�%K�"�$2�5�&�&�$I�$I�!�&6�u�f�f�&M�&M�#�&5�f�f�&E�&E�#�%�#�):�#�>Q�#�Uh�#�"�G��|�|�B�G�K�(�(�
������
�f�@U�1V�1V�
�%�b�g�&6�&6�s�&;�&;�DY�Z�Z�Z�
�!�"�'�,�,�v�z�"B�"B�K`�a�a�a�� �����f�m�E�.B�B�!G�!G�Pe�f�f�f���(�N��O�E�6��<L�M�M�M�M���f�-�-�-����<�<����,�,�
'�����v�}�V�?T�1U�1U�
'�%�b�g�&6�&6�s�&;�&;�DY�Z�Z�Z�
�!�"�'�,�,�v�z�"B�"B�K`�a�a�a�� �����f�m�E�.B�B�!G�!G�Pe�f�f�f���(�2������1G�1G�2��O�E�6��<L�M�M�M�M�"�G�#�D�&�1�1�1��$�#�R�W�^�^�F�-C�-C�#�"�G��7�>�>�&�)�)�'�)8����)O�)O�&�(6�u�f�f�(M�(M�%�*:�5�&�&�*Q�*Q�'�*9�&�&�*I�*I�'�)�'�->�'�BU�'�Yl�'�"&���<�<����,�,�

#�R�W�^�^�F�M�RX�DY�5Z�5Z�

#�%�b�g�&6�&6�v�}�U�7K�&L�&L�Uj�k�k�k�
�!�"�'�,�,�v�z�"B�"B�K`�a�a�a���(�'������1G�1G�'��K��'�'�'�$�R�W�\�\�&�-��2F��%K�%K�Ti�j�j�j�E�)8����)O�)O�&�(6�u�f�f�(M�(M�%�*:�5�&�&�*Q�*Q�'�*9�&�&�*I�*I�'�)�'�->�'�BU�'�Yl�'�"&���$�#�R�W�^�^�F�-C�-C�#�"�G��
�s�:��g����H��.�"-������d��5�5�f�m�$�5�O�O�	�$�C�C�I�x�Xa�Ob�c�c����
�� � �x� � � � � s�>M�N�**N�N�"N=�=
O
�	O
� S3�3
U�=>U�U�1^�
_5�
A_0�0_5�2Gq	�3k	�q	�	
l4�Al/�*q	�/l4�4q	�m+�*q	�+
n�5m<�7q	�<n�A'q	�)o9�8q	�9
q�p�q	�
q�(q�;q	�q�q	�	Ar�r�__main__)+�
__future__rrrr��
__metaclass__�
DOCUMENTATION�EXAMPLES�RETURNr�rxrir:�os.pathr�rcrrfr�r��ansible.module_utils._textrr�ansible.module_utils.basicr�#ansible.module_utils.common.processr	�"ansible.module_utils.common.localer
�ansible.module_utils.sixrr$r�r
r1r=rHrur�r�r�r�rrrr�<module>r�s���A�@�@�@�@�@�@�@�@�@��
�O�
�b?��B=
��~
��������
�
�
�
�	�	�	�	���������
�
�
�
�
�
�
�
�������������:�:�:�:�:�:�:�:�4�4�4�4�4�4�<�<�<�<�<�<�G�G�G�G�G�G�(�(�(�(�(�(�
�����������z�z�z�2�2�2�$
�
�
�>�>�>�B���>2�2�2�j���$h!�h!�h!�V	�z����D�F�F�F�F�F��r

Youez - 2016 - github.com/yon3zu
LinuXploit