�
�Udac @` s� d d l m Z m Z m Z e Z i d d 6d g d 6d d 6Z d Z d Z d d
l Z d d
l
Z
d d l m Z d d l
m Z d
e f d � � YZ d � Z e d k r� e � n d
S( i ( t absolute_importt divisiont print_functions 1.1t metadata_versiont previewt statust coret supported_bysa
---
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) <[email protected]>
notes:
- Requires I(svn) to be installed on the client.
- This module does not handle externals.
options:
repo:
description:
- The subversion URL to the repository.
required: true
aliases: [ name, repository ]
dest:
description:
- Absolute path where the repository should be deployed.
required: true
revision:
description:
- Specific revision to checkout.
default: HEAD
aliases: [ version ]
force:
description:
- If C(yes), modified files will be discarded. If C(no), module will fail if it encounters modified files.
Prior to 1.9 the default was C(yes).
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.
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.
executable:
description:
- Path to svn executable to use. If not supplied,
the normal mechanism for resolving binary paths will be used.
version_added: "1.4"
checkout:
description:
- If C(no), do not check out the repository if it does not exist locally.
type: bool
default: "yes"
version_added: "2.3"
update:
description:
- If C(no), do not retrieve new revisions from the origin repository.
type: bool
default: "yes"
version_added: "2.3"
export:
description:
- If C(yes), do export instead of checkout/update.
type: bool
default: "no"
version_added: "1.6"
switch:
description:
- If C(no), do not call svn switch before update.
default: "yes"
version_added: "2.0"
type: bool
s�
- name: Checkout subversion repository to specified folder
subversion:
repo: svn+ssh://an.example.org/path/to/repo
dest: /src/checkout
- name: Export subversion directory to folder
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
- subversion:
repo: svn+ssh://an.example.org/path/to/repo
dest: /srv/checkout
checkout: no
update: no
N( t LooseVersion( t
AnsibleModulet
Subversionc B` s� e Z d � Z d � Z e d � Z d � Z e d � Z e d � Z d � Z
d � Z d � Z d � Z
d
� Z d � Z d � Z RS(
c C` sC | | _ | | _ | | _ | | _ | | _ | | _ | | _ d S( N( t modulet destt repot revisiont usernamet passwordt svn_path( t selfR R R
R R R R ( ( sM /usr/lib/python2.7/site-packages/ansible/modules/source_control/subversion.pyt __init__z s c C` sC | j j | j d d g d t �\ } } } t | � t d � k S( Ns --versions --quiett check_rcs 1.10.0( R t run_commandR t TrueR ( R t rct versiont err( ( sM /usr/lib/python2.7/site-packages/ansible/modules/source_control/subversion.pyt has_option_password_from_stdin� s -c C` s� | j d d d g } d } | j r= | j d | j g � n | j r� | j � rk | j d � | j } q� | j j d � | j d | j g � n | j | � | j j | | d | �\ } } } | r� | j
� S| Sd S(
su Execute a subversion command, and return output. If check_rc is False, returns the return code instead of the output.s --non-interactives --trust-server-certs --no-auth-caches
--usernames --password-from-stdins� 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.s
--passwordt dataN( R t NoneR t extendR R t appendR t warnR t
splitlines( R t argsR t bitst
stdin_dataR t outR ( ( sM /usr/lib/python2.7/site-packages/ansible/modules/source_control/subversion.pyt _exec� s$
$
c C` s( | j d | j g d t �} | d k S( s Checks if path is a SVN Repo.t infoR i ( R% R t False( R R ( ( sM /usr/lib/python2.7/site-packages/ansible/modules/source_control/subversion.pyt is_svn_repo� s c C` sR d g } | r | j d � n | j d | j | j | j g � | j | � d S( s? Creates new svn working directory if it does not already exist.t checkouts --forces -rN( R R R R
R R% ( R t forcet cmd( ( sM /usr/lib/python2.7/site-packages/ansible/modules/source_control/subversion.pyR) � s
"c C` sR d g } | r | j d � n | j d | j | j | j g � | j | � d S( s Export svn repo to directoryt exports --forces -rN( R R R R
R R% ( R R* R+ ( ( sM /usr/lib/python2.7/site-packages/ansible/modules/source_control/subversion.pyR, � s
"c C` sI | j d | j | j g � } x$ | D] } t j d | � r% t Sq% Wt S( s Change working directory's repo.t switchs ^[ABDUCGE]\s( R% R
R t ret searchR R'