| Server IP : 157.22.201.140 / Your IP : 216.73.216.74 Web Server : nginx/1.30.1 System : Linux mit.vincode.fvds.ru 6.8.0-111-generic #111-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 11 23:16:02 UTC 2026 x86_64 User : root ( 0) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /lib/python3/dist-packages/ansible/modules/__pycache__/ |
Upload File : |
�
1<�e�4 � � � d dl mZmZmZ eZdZdZdZd dl Z d dl
Z
d dlmZ d dl
mZ d dlmZ G d � d
e� Zd� Zedk( r e� yy)
� )�absolute_import�division�print_functiona�
---
module: subversion
short_description: Deploys a subversion repository
description:
- Deploy given repository URL / revision to dest. If dest exists, update to the specified revision, otherwise perform a checkout.
version_added: "0.7"
author:
- Dane Summers (@dsummersl) <njharman@gmail.com>
options:
repo:
description:
- The subversion URL to the repository.
type: str
required: true
aliases: [ name, repository ]
dest:
description:
- Absolute path where the repository should be deployed.
- The destination directory must be specified unless O(checkout=no), O(update=no), and O(export=no).
type: path
revision:
description:
- Specific revision to checkout.
type: str
default: HEAD
aliases: [ rev, version ]
force:
description:
- If V(true), modified files will be discarded. If V(false), module will fail if it encounters modified files.
Prior to 1.9 the default was V(true).
type: bool
default: "no"
in_place:
description:
- If the directory exists, then the working copy will be checked-out over-the-top using
svn checkout --force; if force is specified then existing files with different content are reverted.
type: bool
default: "no"
version_added: "2.6"
username:
description:
- C(--username) parameter passed to svn.
type: str
password:
description:
- C(--password) parameter passed to svn when svn is less than version 1.10.0. This is not secure and
the password will be leaked to argv.
- C(--password-from-stdin) parameter when svn is greater or equal to version 1.10.0.
type: str
executable:
description:
- Path to svn executable to use. If not supplied,
the normal mechanism for resolving binary paths will be used.
type: path
version_added: "1.4"
checkout:
description:
- If V(false), do not check out the repository if it does not exist locally.
type: bool
default: "yes"
version_added: "2.3"
update:
description:
- If V(false), do not retrieve new revisions from the origin repository.
type: bool
default: "yes"
version_added: "2.3"
export:
description:
- If V(true), do export instead of checkout/update.
type: bool
default: "no"
version_added: "1.6"
switch:
description:
- If V(false), do not call svn switch before update.
default: "yes"
version_added: "2.0"
type: bool
validate_certs:
description:
- If V(false), passes the C(--trust-server-cert) flag to svn.
- If V(true), does not pass the flag.
default: "no"
version_added: "2.11"
type: bool
extends_documentation_fragment: action_common_attributes
attributes:
check_mode:
support: full
diff_mode:
support: none
platform:
platforms: posix
notes:
- This module does not handle externals.
requirements:
- subversion (the command line tool with C(svn) entrypoint)
a+
- name: Checkout subversion repository to specified folder
ansible.builtin.subversion:
repo: svn+ssh://an.example.org/path/to/repo
dest: /src/checkout
- name: Export subversion directory to folder
ansible.builtin.subversion:
repo: svn+ssh://an.example.org/path/to/repo
dest: /src/export
export: yes
- name: Get information about the repository whether or not it has already been cloned locally
ansible.builtin.subversion:
repo: svn+ssh://an.example.org/path/to/repo
dest: /src/checkout
checkout: no
update: no
�#N)�
AnsibleModule)�get_best_parsable_locale)�LooseVersionc �d � e Zd ZdZd� Zd� Zdd�Zd� Zdd�Zdd�Z d� Z
d � Zd
� Zd� Z
d� Zd
� Zd� Zy)�
Subversionz^\w+\s?:\s+\d+$c �t � || _ || _ || _ || _ || _ || _ || _ || _ y )N)�module�dest�repo�revision�username�password�svn_path�validate_certs) �selfr
r r r r r r r s �</usr/lib/python3/dist-packages/ansible/modules/subversion.py�__init__zSubversion.__init__� s; � ������ ��� � ��
� ��
� ��
� ��
�,��� c � � | j j | j ddgd�� \ }}}t |� t d� k\ S )Nz --version�--quietT��check_rcz1.10.0)r
�run_commandr r )r �rc�version�errs r �has_option_password_from_stdinz)Subversion.has_option_password_from_stdin� sD � ��;�;�2�2�D�M�M�;�PY�3Z�ei�2�j���G�S��G�$��X�(>�>�>r c �" � | j ddg}| j s|j d� d}| j r|j d| j g� | j
rf| j
� r|j d� | j
}n8| j j d� |j d| j
g� |j |� | j j |||� � \ }}}|r|j � S |S )
zuExecute a subversion command, and return output. If check_rc is False, returns the return code instead of the output.z--non-interactivez--no-auth-cachez--trust-server-certNz
--usernamez--password-from-stdinz�The authentication provided will be used on the svn command line and is not secure. To securely pass credentials, upgrade svn to version 1.10.0 or greater.z
--password)�data)r r �appendr �extendr r! r
�warnr �
splitlines)r �argsr �bits�
stdin_datar �outr s r �_execzSubversion._exec� s� � �
�M�M���
��
�"�"��K�K�-�.��
��=�=��K�K��t�}�}�5�6��=�=��2�2�4����3�4�!�]�]�
���� � � "k� l����\�4�=�=�9�:����D���{�{�.�.�t�X�J�.�O���C����>�>�#�#��Ir c �J � | j d| j gd�� }|dk( S )zChecks if path is a SVN Repo.�infoFr r )r, r )r r s r �is_svn_repozSubversion.is_svn_repo� s&