ansible.builtin.subversion – Deploys a subversion repository

Note

This module is part of ansible-core and included in all Ansible installations. In most cases, you can use the short module name subversion even without specifying the collections: keyword. However, we recommend you use the FQCN for easy linking to the module documentation and to avoid conflicting with other collections that may have the same module name.

New in version 0.7: of ansible.builtin

Synopsis

  • Deploy given repository URL / revision to dest. If dest exists, update to the specified revision, otherwise perform a checkout.

Requirements

The below requirements are needed on the host that executes this module.

  • subversion (the command line tool with svn entrypoint)

Parameters

Parameter

Comments

checkout

boolean

added in 2.3 of ansible.builtin

If no, do not check out the repository if it does not exist locally.

Choices:

  • no

  • yes ← (default)

dest

path

Absolute path where the repository should be deployed.

The destination directory must be specified unless checkout=no, update=no, and export=no.

executable

path

added in 1.4 of ansible.builtin

Path to svn executable to use. If not supplied, the normal mechanism for resolving binary paths will be used.

export

boolean

added in 1.6 of ansible.builtin

If yes, do export instead of checkout/update.

Choices:

  • no ← (default)

  • yes

force

boolean

If yes, modified files will be discarded. If no, module will fail if it encounters modified files. Prior to 1.9 the default was yes.

Choices:

  • no ← (default)

  • yes

in_place

boolean

added in 2.6 of ansible.builtin

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.

Choices:

  • no ← (default)

  • yes

password

string

--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.

--password-from-stdin parameter when svn is greater or equal to version 1.10.0.

repo

aliases: name, repository

string / required

The subversion URL to the repository.

revision

aliases: rev, version

string

Specific revision to checkout.

Default: “HEAD”

switch

boolean

added in 2.0 of ansible.builtin

If no, do not call svn switch before update.

Choices:

  • no

  • yes ← (default)

update

boolean

added in 2.3 of ansible.builtin

If no, do not retrieve new revisions from the origin repository.

Choices:

  • no

  • yes ← (default)

username

string

--username parameter passed to svn.

validate_certs

boolean

added in 2.11 of ansible.builtin

If no, passes the --trust-server-cert flag to svn.

If yes, does not pass the flag.

Choices:

  • no ← (default)

  • yes

Notes

Note

  • This module does not handle externals.

  • Supports check_mode.

Examples

- 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

Authors