From 3d4f2f81eace493052b9dc038a12ef900554025b Mon Sep 17 00:00:00 2001 From: Lauren Rother Date: Tue, 17 Jun 2014 15:10:52 -0700 Subject: Update README to conform with template Add template sections and organization to original README. Add information about providers, features, and parameters. General edits for clarity and completeness. --- README.markdown | 477 +++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 459 insertions(+), 18 deletions(-) (limited to 'README.markdown') diff --git a/README.markdown b/README.markdown index 8487256..d0b9169 100644 --- a/README.markdown +++ b/README.markdown @@ -1,32 +1,473 @@ -vcsrepo -======= +#vcsrepo [![Build Status](https://travis-ci.org/puppetlabs/puppetlabs-vcsrepo.png?branch=master)](https://travis-ci.org/puppetlabs/puppetlabs-vcsrepo) -Purpose -------- +####Table of Contents -This provides a single type, `vcsrepo`. +1. [Overview](#overview) +2. [Module Description - What the module does and why it is useful](#module-description) +3. [Setup - The basics of getting started with vcsrepo](#setup) + * [Beginning with vcsrepo](#beginning-with-vcsrepo) +4. [Usage - Configuration options and additional functionality](#usage) + * [Bazaar](#bazaar) + * [CVS](#cvs) + * [Git](#git) + * [Mercurial](#mercurial) + * [Subversion](#subversion) +5. [Reference - An under-the-hood peek at what the module is doing and how](#reference) + * [Type: vcsrepo](#type-vcsrepo) + * [Providers](#providers) + * [Features](#features) + * [Parameters](#parameters) + * [Features and Parameters by Provider](#features-and-parameters-by-provider) +5. [Limitations - OS compatibility, etc.](#limitations) +6. [Development - Guide for contributing to the module](#development) -This type can be used to describe: +##Overview + +The vcsrepo module allows you to use Puppet to easily deploy code from your version control system (VCS). + +##Module Description + +This module provides a single type with providers for each VCS, which can be used to describe: * A working copy checked out from a (remote or local) source, at an arbitrary revision -* A "blank" working copy not associated with a source (when it makes +* A blank working copy not associated with a source (when it makes sense for the VCS being used) -* A "blank" central repository (when the distinction makes sense for the VCS - being used) +* A blank central repository (when the distinction makes sense for the VCS + being used) + +##Setup + +###Beginning with vcsrepo + +To get started with the vcsrepo module, you must simply define the type `vcsrepo` with a path to your repository and the [type of VCS](#Usage) you're using in `provider` (in the below example, Git). + + vcsrepo { "/path/to/repo": + ensure => present, + provider => git, + } + +##Usage + +The vcsrepo module works with the following VCSs: + +* [Bazaar (bzr)](#bazaar) +* [CVS (cvs)](#cvs) +* [Git (git)](#git) +* [Mercurial (hg)](#mercurial) +* [Subversion (svn)](#subversion) + +###Bazaar + +#####Create a blank repository + +To create a blank repository suitable for use as a central repository, +define `vcsrepo` without `source` or `revision`. + + vcsrepo { "/path/to/repo": + ensure => present, + provider => bzr, + } + +#####Branch from an existing repository + +Provide the `source` location to branch from an existing repository. + + vcsrepo { "/path/to/repo": + ensure => present, + provider => bzr, + source => 'lp:myproj', + } + +For a specific revision, use `revision` with a valid revisionspec +(see `bzr help revisionspec` for more information on formatting a revision). + + vcsrepo { "/path/to/repo": + ensure => present, + provider => bzr, + source => 'lp:myproj', + revision => 'menesis@pov.lt-20100309191856-4wmfqzc803fj300x', + } + +#####Sources that use SSH + +When your source uses SSH, for instance 'bzr+ssh://...' or 'sftp://...,' +you can manage your SSH keys with Puppet using the [require](http://docs.puppetlabs.com/references/stable/metaparameter.html#require) metaparameter in `vcsrepo` to ensure they are present. + +#####Further examples + +For more examples using Bazaar, see `examples/bzr/`. + +###CVS + +#####To create a blank repository + +To create a blank repository suitable for use as a central repository, +define `vcsrepo` without `source` or `revision`. + + vcsrepo { "/path/to/repo": + ensure => present, + provider => cvs, + } + +#####To checkout/update from a repository + +To get the current mainline, + + vcsrepo { "/path/to/workspace": + ensure => present, + provider => cvs, + source => ":pserver:anonymous@example.com:/sources/myproj", + } + +To get a specific module on the current mainline, + + vcsrepo {"/vagrant/lockss-daemon-source": + ensure => present, + provider => cvs, + source => ":pserver:anonymous@lockss.cvs.sourceforge.net:/cvsroot/lockss", + module => "lockss-daemon", + } + + +You can use the `compression` parameter to set the GZIP compression levels for your repository history. + + vcsrepo { "/path/to/workspace": + ensure => present, + provider => cvs, + compression => 3, + source => ":pserver:anonymous@example.com:/sources/myproj", + } + +For a specific tag, use `revision`. + + vcsrepo { "/path/to/workspace": + ensure => present, + provider => cvs, + compression => 3, + source => ":pserver:anonymous@example.com:/sources/myproj", + revision => "SOMETAG", + } + +#####Sources that use SSH + +When your source uses SSH, you can manage your SSH keys with Puppet using the [require](http://docs.puppetlabs.com/references/stable/metaparameter.html#require) metaparameter in `vcsrepo` to ensure they are present. + +#####Further examples + +For for more examples using CVS, see `examples/cvs/`. + +###Git + +#####To create a blank repository + +To create a blank repository suitable for use as a central repository, +define `vcsrepo` without `source` or `revision`. + + vcsrepo { "/path/to/repo": + ensure => present, + provider => git, + } + +If you're defining `vcsrepo` for a central or official repository, you may want to make it a bare repository. You do this by setting `ensure` to 'bare' rather than 'present'. + + vcsrepo { "/path/to/repo": + ensure => bare, + provider => git, + } + +#####To clone/pull a repository + +To get the current HEAD on the master branch, + + vcsrepo { "/path/to/repo": + ensure => present, + provider => git, + source => "git://example.com/repo.git", + } + +To get a specific revision or branch (can be a commit SHA, tag, or branch name), + + **SHA** + + vcsrepo { "/path/to/repo": + ensure => present, + provider => git, + source => 'git://example.com/repo.git', + revision => '0c466b8a5a45f6cd7de82c08df2fb4ce1e920a31', + } + +**Tag** + + vcsrepo { "/path/to/repo": + ensure => present, + provider => git, + source => 'git://example.com/repo.git', + revision => '1.1.2rc1', + } + +**Branch name** + + vcsrepo { "/path/to/repo": + ensure => present, + provider => git, + source => 'git://example.com/repo.git', + revision => 'development', + } + +To check out a branch as a specific user, + + vcsrepo { "/path/to/repo": + ensure => present, + provider => git, + source => 'git://example.com/repo.git', + revision => '0c466b8a5a45f6cd7de82c08df2fb4ce1e920a31', + user => 'someUser', + } + +To keep the repository at the latest revision (**WARNING:** this will always overwrite local changes to the repository), + + vcsrepo { "/path/to/repo": + ensure => latest, + provider => git, + source => 'git://example.com/repo.git', + revision => 'master', + } + +#####Sources that use SSH + +When your source uses SSH, such as 'username@server:…', you can manage your SSH keys with Puppet using the [require](http://docs.puppetlabs.com/references/stable/metaparameter.html#require) metaparameter in `vcsrepo` to ensure they are present. + +For SSH keys associated with a user, enter the username in the `user` parameter. Doing so will use that user's keys. + + user => 'toto' # will use toto's $HOME/.ssh setup + +#####Further Examples + +For for more examples using Git, see `examples/git/`. + +###Mercurial + +#####To create a blank repository + +To create a blank repository suitable for use as a central repository, +define `vcsrepo` without `source` or `revision`. + + vcsrepo { "/path/to/repo": + ensure => present, + provider => hg, + } + +#####To clone/pull & update a repository + +To get the default branch tip, + + vcsrepo { "/path/to/repo": + ensure => present, + provider => hg, + source => "http://hg.example.com/myrepo", + } + +For a specific changeset, use `revision`. + + vcsrepo { "/path/to/repo": + ensure => present, + provider => hg, + source => "http://hg.example.com/myrepo", + revision => '21ea4598c962', + } + +You can also set `revision` to a tag. + + vcsrepo { "/path/to/repo": + ensure => present, + provider => hg, + source => "http://hg.example.com/myrepo", + revision => '1.1.2', + } + +To check out as a specific user, + + vcsrepo { "/path/to/repo": + ensure => present, + provider => hg, + source => "http://hg.example.com/myrepo", + user => 'user', + } + +To specify an SSH identity key, + + vcsrepo { "/path/to/repo": + ensure => present, + provider => hg, + source => "ssh://hg@hg.example.com/myrepo", + identity => "/home/user/.ssh/id_dsa, + } + +#####Sources that use SSH + +When your source uses SSH, such as 'ssh://...', you can manage your SSH keys with Puppet using the [require](http://docs.puppetlabs.com/references/stable/metaparameter.html#require) metaparameter in `vcsrepo` to ensure they are present. + +#####Further Examples + +For more examples using Mercurial, see `examples/hg/`. + +###Subversion + +#####To create a blank repository + +To create a blank repository suitable for use as a central repository, +define `vcsrepo` without `source` or `revision`. + + vcsrepo { "/path/to/repo": + ensure => present, + provider => svn, + } + +#####To check out from a repository + +Provide a `source` pointing to the branch/tag you want to check out from a repository. + + vcsrepo { "/path/to/repo": + ensure => present, + provider => svn, + source => "svn://svnrepo/hello/branches/foo", + } + +You can also provide a specific revision. + + vcsrepo { "/path/to/repo": + ensure => present, + provider => svn, + source => "svn://svnrepo/hello/branches/foo", + revision => '1234', + } + +#####Using a specific Subversion configuration directory + +To use a specific configuration directory, provide a `configuration` parameter which should be a directory path on the local system where your svn configuration files are. Typically, it is '/path/to/.subversion'. + + vcsrepo { "/path/to/repo": + ensure => present, + provider => svn, + source => "svn://svnrepo/hello/branches/foo", + configuration => "/path/to/.subversion", + } + +#####Sources that use SSH + +When your source uses SSH, such as 'svn+ssh://...', you can manage your SSH keys with Puppet using the [require](http://docs.puppetlabs.com/references/stable/metaparameter.html#require) metaparameter in `vcsrepo` to ensure they are present. + +####Further examples + +For more examples using Subversion, see `examples/svn/`. + +##Reference + +###Type: vcsrepo + +The vcsrepo module is slightly unusual in that it is simply a type and providers. Each provider abstracts a different VCS, and a series of features are available to each provider based on its specific needs. + +####Providers + +**Note**: Not all features are available with all providers. + +* `bar` - Supports the Bazaar VCS. (Contains features: `reference_tracking`.) +* `cvs` - Supports the CVS VCS. (Contains features: `cvs_rsh`, `gzip_compression`, `modules`,`reference_tracking`.) +* `dummy` - +* `git` - Supports the Git VCS. (Contains features: `bare_repositories`, `depth`, `multiple_remotes`, `reference_tracking`, `ssh_identity`, `user`.) +* `hg` - Supports the Mercurial VCS. (Contains features: `reference_tracking`, `ssh_identity`, `user`.) +* `svn` - Supports the Subversion VCS. (Contains features: `basic_auth`, `configuration`, `filesystem_types`, `reference_tracking`.) + +####Features + +**Note**: Not all features are available with all providers. + +* `bare_repositories` - The provider differentiates between bare repositories and those with working copies. (Available with `git`.) +* `basic_auth` - The provider supports HTTP Basic Authentication. (Available with `svn`.) +* `configuration` - The provider supports setting the configuration path.(Available with `svn`.) +* `cvs_rsh` - The provider understands the CVS_RSH environment variable. (Available with `cvs`.) +* `depth` - The provider can do shallow clones. (Available with `git`.) +* `filesystem_types` - The provider supports different filesystem types. (Available with `svn`.) +* `gzip_compression` - The provider supports explicit GZip compression levels. (Available with `cvs`.) +* `modules` - The provider allows specific repository modules to be chosen. (Available with `cvs`.) +* `multiple_remotes` - The repository tracks multiple remote repositories. (Available with `git`.) +* `reference_tracking` - The provider supports tracking revision references that can change over time (e.g. some VCS tags and branch names). (Available with `bar`, `cvs`, `git`, `hg`, `svn`.) +* `ssh_identity` - The provider supports a configurable SSH identity file. (Available with `git` and `hg`.) +* `user` - The provider can run as a different user. (Available with `git` and `hg`.) + +####Parameters + +* `basic_auth_password` - Specifies the HTTP Basic Authentication password. (Requires the `basic_auth` feature.) +* `basic_auth_username` - Specifies the HTTP Basic Authentication username. (Requires the `basic_auth` feature.) +* `compression` - Set the GZIP compression levels for your repository history. (Requires the `gzip_compression` feature.) +* `configuration` - Sets the configuration directory to use. (Requires the `configuration` feature.) +* `cvs_rsh` - The value to be used for the CVS_RSH environment variable. (Requires the `cvs_rsh` feature.) +* `depth` - The value to be used to do a shallow clone. (Requires the `depth` feature.) +* `ensure` - Determines the state of the repository. Valid values are 'present', 'bare', 'absent', 'latest'. +* `excludes` - Lists any files to be excluded from the repository. +* `force` - Forces repository creation. Valid values are 'true' and 'false'. **WARNING** Forcing will destroy any files in the path. +* `fstype` - Sets the filesystem type. (Requires the `filesystem_types` feature.) +* `group` - Determines the group/gid that owns the repository files. +* `identity` - Specifies the SSH identity file. (Requires the `ssh_identity` feature.) +* `module` - Specifies the repository module to manage. (Requires the `modules` feature.) +* `owner` - Specifies the user/uid that owns the repository files. +* `path` - Specifies the absolute path to the repository. If omitted, the value defaults to the resource's title. +* `provider` - The specific backend to use for this vcsrepo resource. Puppet will usually discover the appropriate provider for your platform. +* `remote` - Specifies the remote repository to track. (Requires the `multiple_remotes` feature.) +* `revision` - Sets the revision of the repository. Values can match /^\S+$/. +* `source` - Specifies the source URI for the repository. +* `user` - Specifies the user to run as for repository operations. + +####Features and Parameters by Provider + +#####`bzr` +**Features**: `reference_tracking` + +**Parameters**: `ensure`, `excludes`, `force`, `group`, `owner`, `path`, `provider`, `revision`, `source`, `user` + +#####`cvs` +**Features**: `cvs_rsh`, `gzip_compression`, `modules`, `reference_tracking`, `revision` + +**Parameters**: `compression`, `cvs_rsh`, `ensure`, `excludes`, `force`, `group`, `module`, `owner`, `path`, `provider`, `revision`, `source`, `user` + +#####`git` +**Features**: `bare_repositories`, `depth`, `multiple_remotes`, `reference_tracking`, `ssh_identity`, `user` + +**Parameters**: `depth`, `ensure`, `excludes`, `force`, `group`, `identity`, `owner`, `path`, `provider`, `remote`, `revision`, `source`, `user` + +#####`hg` +**Features**: `reference_tracking`, `ssh_identity`, `user` + +**Parameters**: `ensure`, `excludes`, `force`, `group`, `identity`, `owner`, `path`, `provider`, `revision`, `source`, `user` + +#####`svn` +**Features**: `basic_auth`, `configuration`, `filesystem_types`, `reference_tracking` + +**Parameters**: `basic_auth_password`, `basic_auth_username`, `configuration`, `ensure`, `excludes`, `force`, `fstype`, `group`, `owner`, `path`, `provider`, `revision`, `source`, `user` + +##Limitations + +This module has been built on and tested against Puppet 2.7 and higher. + +The module has been tested on: + +RedHat Enterprise Linux 5/6 +Debian 6/7 +CentOS 5/6 +Ubuntu 12.04 +Gentoo +Arch Linux +FreeBSD -Supported Version Control Systems ---------------------------------- +Testing on other platforms has been light and cannot be guaranteed. -This module supports a wide range of VCS types, each represented by a -separate provider. +##Development -For information on how to use this module with a specific VCS, see -`README..markdown`. +Puppet Labs modules on the Puppet Forge are open projects, and community contributions are essential for keeping them great. We can’t access the huge number of platforms and myriad of hardware, software, and deployment configurations that Puppet is intended to serve. -License -------- +We want to keep it as easy as possible to contribute changes so that our modules work in your environment. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things. -See LICENSE. +You can read the complete module contribution guide on the Puppet Labs wiki. \ No newline at end of file -- cgit v1.2.3 From 8e4a9d2201c73fdd8d2601fcdec64f4089dbdb8f Mon Sep 17 00:00:00 2001 From: Lauren Rother Date: Tue, 17 Jun 2014 15:18:10 -0700 Subject: Remove extra READMEs Delete the per-VCS readmes. They are all combined in the main readme now. --- README.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'README.markdown') diff --git a/README.markdown b/README.markdown index d0b9169..39cd249 100644 --- a/README.markdown +++ b/README.markdown @@ -25,7 +25,7 @@ ##Overview -The vcsrepo module allows you to use Puppet to easily deploy code from your version control system (VCS). +The vcsrepo module allows you to use Puppet to easily deploy content from your version control system (VCS). ##Module Description @@ -246,7 +246,7 @@ For SSH keys associated with a user, enter the username in the `user` parameter. #####Further Examples -For for more examples using Git, see `examples/git/`. +For more examples using Git, see `examples/git/`. ###Mercurial @@ -415,7 +415,7 @@ The vcsrepo module is slightly unusual in that it is simply a type and providers * `module` - Specifies the repository module to manage. (Requires the `modules` feature.) * `owner` - Specifies the user/uid that owns the repository files. * `path` - Specifies the absolute path to the repository. If omitted, the value defaults to the resource's title. -* `provider` - The specific backend to use for this vcsrepo resource. Puppet will usually discover the appropriate provider for your platform. +* `provider` - Specifies the backend to use for this vcsrepo resource. * `remote` - Specifies the remote repository to track. (Requires the `multiple_remotes` feature.) * `revision` - Sets the revision of the repository. Values can match /^\S+$/. * `source` - Specifies the source URI for the repository. -- cgit v1.2.3 From ac4e14770fc04db02be2f48f6de675e90e3f6b29 Mon Sep 17 00:00:00 2001 From: Paul Allen Date: Fri, 20 Jun 2014 11:45:58 +0100 Subject: Moved p4.markdown content to project's markdown --- README.markdown | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) (limited to 'README.markdown') diff --git a/README.markdown b/README.markdown index 39cd249..6dc36d2 100644 --- a/README.markdown +++ b/README.markdown @@ -13,6 +13,7 @@ * [CVS](#cvs) * [Git](#git) * [Mercurial](#mercurial) + * [Perforce](#perforce) * [Subversion](#subversion) 5. [Reference - An under-the-hood peek at what the module is doing and how](#reference) * [Type: vcsrepo](#type-vcsrepo) @@ -57,6 +58,7 @@ The vcsrepo module works with the following VCSs: * [CVS (cvs)](#cvs) * [Git (git)](#git) * [Mercurial (hg)](#mercurial) +* [Perforce (p4)](#perforce) * [Subversion (svn)](#subversion) ###Bazaar @@ -314,6 +316,96 @@ When your source uses SSH, such as 'ssh://...', you can manage your SSH keys wit For more examples using Mercurial, see `examples/hg/`. +###Perforce + +#####To create an empty Workspace + +To create an empty Workspace, define a `vcsrepo` without a `source` or `revision`. The +Environment variables P4PORT, P4USER, etc... are used to define the Perforce server +connection settings. + + vcsrepo { "/path/to/repo": + ensure => present, + provider => p4 + } + +If no `p4client` name is provided a workspace generated name is calculated based on the +Digest of path. For example: + + puppet-91bc00640c4e5a17787286acbe2c021c + +Providing a `p4client` name will create/update the client workspace in Perforce. The +value replaces the P4CLIENT environment variable. + + vcsrepo { "/path/to/repo": + ensure => present, + provider => p4 + p4client => "my_client_ws" + } + +#####To create/update and sync a Perforce workspace + +To sync a depot path to head (latest): + + vcsrepo { "/path/to/repo": + ensure => present, + provider => p4, + source => '//depot/branch/...' + } + +For a specific changelist, use `revision`: + + vcsrepo { "/path/to/repo": + ensure => present, + provider => p4, + source => '//depot/branch/...', + revision => '2341' + } + +You can also set `revision` to a label: + + vcsrepo { "/path/to/repo": + ensure => present, + provider => p4, + source => '//depot/branch/...', + revision => 'my_label' + } + +Check out as a user by setting `p4user`: + + vcsrepo { "/path/to/repo": + ensure => present, + provider => p4, + source => '//depot/branch/...', + p4user => 'user' + } + +You can set `p4port` to specify a Perforce server: + + vcsrepo { "/path/to/repo": + ensure => present, + provider => p4, + source => '//depot/branch/...', + p4port => 'ssl:perforce.com:1666' + } + +You can set `p4passwd` for authentication : + + vcsrepo { "/path/to/repo": + ensure => present, + provider => p4, + source => '//depot/branch/...', + p4port => 'ssl:perforce.com:1666' + } + +If `p4port`, `p4user`, `p4charset`, `p4passwd` or `p4client` are specified they will +override the environment variabels P4PORT, P4USER, etc... If a P4CONFIG file is defined, +the config file settings will take precedence. + +#####Further Examples + +For examples you can run, see `examples/p4/` + ###Subversion #####To create a blank repository -- cgit v1.2.3 From 319f9fbe1954fd172da638f3ccd76e58c3ec8c7f Mon Sep 17 00:00:00 2001 From: Paul Allen Date: Mon, 23 Jun 2014 15:51:28 +0100 Subject: Added support for p4config. - Removed p4port, p4client, p4user to keep name space clean. - Changed notify to Puppet.debug - Updated markdown and examples - Updated unit tests --- README.markdown | 45 ++++++++++----------------------------------- 1 file changed, 10 insertions(+), 35 deletions(-) (limited to 'README.markdown') diff --git a/README.markdown b/README.markdown index 6dc36d2..5f8aa9d 100644 --- a/README.markdown +++ b/README.markdown @@ -329,18 +329,19 @@ connection settings. provider => p4 } -If no `p4client` name is provided a workspace generated name is calculated based on the -Digest of path. For example: +If no `P4CLIENT` environment name is provided a workspace generated name is calculated +based on the Digest of path. For example: puppet-91bc00640c4e5a17787286acbe2c021c -Providing a `p4client` name will create/update the client workspace in Perforce. The -value replaces the P4CLIENT environment variable. +A Perforce configuration file can be used by setting the `P4CONFIG` environment or +defining `p4config`. If a configuration is defined, then the environment variable for +`P4CLIENT` is replaced. vcsrepo { "/path/to/repo": ensure => present, - provider => p4 - p4client => "my_client_ws" + provider => p4, + p4config => '.p4config' } #####To create/update and sync a Perforce workspace @@ -371,36 +372,10 @@ You can also set `revision` to a label: revision => 'my_label' } -Check out as a user by setting `p4user`: - - vcsrepo { "/path/to/repo": - ensure => present, - provider => p4, - source => '//depot/branch/...', - p4user => 'user' - } - -You can set `p4port` to specify a Perforce server: - - vcsrepo { "/path/to/repo": - ensure => present, - provider => p4, - source => '//depot/branch/...', - p4port => 'ssl:perforce.com:1666' - } - -You can set `p4passwd` for authentication : - - vcsrepo { "/path/to/repo": - ensure => present, - provider => p4, - source => '//depot/branch/...', - p4port => 'ssl:perforce.com:1666' - } +#####To authenticate against the Perforce server -If `p4port`, `p4user`, `p4charset`, `p4passwd` or `p4client` are specified they will -override the environment variabels P4PORT, P4USER, etc... If a P4CONFIG file is defined, -the config file settings will take precedence. +Either set the environment variables `P4USER` and `P4PASSWD` or use a configuration file. +For secure servers set the `P4PASSWD` with a valid ticket generated using `p4 login -p`. #####Further Examples -- cgit v1.2.3 From 457035ec1c15df0d53abf7232dad63b2722b1720 Mon Sep 17 00:00:00 2001 From: Paul Allen Date: Mon, 23 Jun 2014 16:22:35 +0100 Subject: Add hostname to Digest for default client name. --- README.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README.markdown') diff --git a/README.markdown b/README.markdown index 5f8aa9d..575950c 100644 --- a/README.markdown +++ b/README.markdown @@ -330,7 +330,7 @@ connection settings. } If no `P4CLIENT` environment name is provided a workspace generated name is calculated -based on the Digest of path. For example: +based on the Digest of path and hostname. For example: puppet-91bc00640c4e5a17787286acbe2c021c -- cgit v1.2.3 From 2ff03cff1795d3e43c922f7bceb235ce69175013 Mon Sep 17 00:00:00 2001 From: Stuart Whelan Date: Sat, 21 Jun 2014 17:26:14 +1200 Subject: Added support for basic authentication to hg provider Updated unit tests Updated hg readme and added examples --- README.markdown | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'README.markdown') diff --git a/README.markdown b/README.markdown index 39cd249..99c5ac9 100644 --- a/README.markdown +++ b/README.markdown @@ -306,6 +306,16 @@ To specify an SSH identity key, identity => "/home/user/.ssh/id_dsa, } +To specify a username and password for HTTP Basic authentication, + + vcsrepo { "/path/to/repo": + ensure => latest, + provider => hg, + source => 'http://hg.example.com/myrepo', + basic_auth_username => 'hgusername', + basic_auth_password => 'hgpassword', + } + #####Sources that use SSH When your source uses SSH, such as 'ssh://...', you can manage your SSH keys with Puppet using the [require](http://docs.puppetlabs.com/references/stable/metaparameter.html#require) metaparameter in `vcsrepo` to ensure they are present. @@ -470,4 +480,4 @@ Puppet Labs modules on the Puppet Forge are open projects, and community contrib We want to keep it as easy as possible to contribute changes so that our modules work in your environment. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things. -You can read the complete module contribution guide on the Puppet Labs wiki. \ No newline at end of file +You can read the complete module contribution guide on the Puppet Labs wiki. -- cgit v1.2.3 From e1aa644dd075c275dd22d85cdc03c88dda029d87 Mon Sep 17 00:00:00 2001 From: Paul Allen Date: Tue, 24 Jun 2014 13:57:30 +0100 Subject: Support streams and fix Marshal for 'p4 cstat' --- README.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'README.markdown') diff --git a/README.markdown b/README.markdown index 575950c..d977886 100644 --- a/README.markdown +++ b/README.markdown @@ -346,15 +346,15 @@ defining `p4config`. If a configuration is defined, then the environment variab #####To create/update and sync a Perforce workspace -To sync a depot path to head (latest): +To sync a depot path to head, ensure `latest`: vcsrepo { "/path/to/repo": - ensure => present, + ensure => latest, provider => p4, source => '//depot/branch/...' } -For a specific changelist, use `revision`: +For a specific changelist, ensure `present` and specify a `revision`: vcsrepo { "/path/to/repo": ensure => present, -- cgit v1.2.3 From a73df3732f942d010dc7b289804bb6d8a6f13a37 Mon Sep 17 00:00:00 2001 From: Lauren Rother Date: Wed, 25 Jun 2014 10:39:37 -0700 Subject: Add supported information and reorder to highlight support Include notice that Git is the only supported provider and reorder README so Git is the first VCS addressed. --- README.markdown | 197 +++++++++++++++++++++++++++++--------------------------- 1 file changed, 101 insertions(+), 96 deletions(-) (limited to 'README.markdown') diff --git a/README.markdown b/README.markdown index 39cd249..93b23d2 100644 --- a/README.markdown +++ b/README.markdown @@ -53,12 +53,104 @@ To get started with the vcsrepo module, you must simply define the type `vcsrepo The vcsrepo module works with the following VCSs: +* [Git (git)](#git)* * [Bazaar (bzr)](#bazaar) * [CVS (cvs)](#cvs) -* [Git (git)](#git) * [Mercurial (hg)](#mercurial) * [Subversion (svn)](#subversion) +**Note:* Git is the only VCS provider officially [supported](https://forge.puppetlabs.com/supported) by Puppet Labs. + + +###Git + +#####To create a blank repository + +To create a blank repository suitable for use as a central repository, +define `vcsrepo` without `source` or `revision`. + + vcsrepo { "/path/to/repo": + ensure => present, + provider => git, + } + +If you're defining `vcsrepo` for a central or official repository, you may want to make it a bare repository. You do this by setting `ensure` to 'bare' rather than 'present'. + + vcsrepo { "/path/to/repo": + ensure => bare, + provider => git, + } + +#####To clone/pull a repository + +To get the current HEAD on the master branch, + + vcsrepo { "/path/to/repo": + ensure => present, + provider => git, + source => "git://example.com/repo.git", + } + +To get a specific revision or branch (can be a commit SHA, tag, or branch name), + + **SHA** + + vcsrepo { "/path/to/repo": + ensure => present, + provider => git, + source => 'git://example.com/repo.git', + revision => '0c466b8a5a45f6cd7de82c08df2fb4ce1e920a31', + } + +**Tag** + + vcsrepo { "/path/to/repo": + ensure => present, + provider => git, + source => 'git://example.com/repo.git', + revision => '1.1.2rc1', + } + +**Branch name** + + vcsrepo { "/path/to/repo": + ensure => present, + provider => git, + source => 'git://example.com/repo.git', + revision => 'development', + } + +To check out a branch as a specific user, + + vcsrepo { "/path/to/repo": + ensure => present, + provider => git, + source => 'git://example.com/repo.git', + revision => '0c466b8a5a45f6cd7de82c08df2fb4ce1e920a31', + user => 'someUser', + } + +To keep the repository at the latest revision (**WARNING:** this will always overwrite local changes to the repository), + + vcsrepo { "/path/to/repo": + ensure => latest, + provider => git, + source => 'git://example.com/repo.git', + revision => 'master', + } + +#####Sources that use SSH + +When your source uses SSH, such as 'username@server:…', you can manage your SSH keys with Puppet using the [require](http://docs.puppetlabs.com/references/stable/metaparameter.html#require) metaparameter in `vcsrepo` to ensure they are present. + +For SSH keys associated with a user, enter the username in the `user` parameter. Doing so will use that user's keys. + + user => 'toto' # will use toto's $HOME/.ssh setup + +#####Further Examples + +For more examples using Git, see `examples/git/`. + ###Bazaar #####Create a blank repository @@ -159,95 +251,6 @@ When your source uses SSH, you can manage your SSH keys with Puppet using the [r For for more examples using CVS, see `examples/cvs/`. -###Git - -#####To create a blank repository - -To create a blank repository suitable for use as a central repository, -define `vcsrepo` without `source` or `revision`. - - vcsrepo { "/path/to/repo": - ensure => present, - provider => git, - } - -If you're defining `vcsrepo` for a central or official repository, you may want to make it a bare repository. You do this by setting `ensure` to 'bare' rather than 'present'. - - vcsrepo { "/path/to/repo": - ensure => bare, - provider => git, - } - -#####To clone/pull a repository - -To get the current HEAD on the master branch, - - vcsrepo { "/path/to/repo": - ensure => present, - provider => git, - source => "git://example.com/repo.git", - } - -To get a specific revision or branch (can be a commit SHA, tag, or branch name), - - **SHA** - - vcsrepo { "/path/to/repo": - ensure => present, - provider => git, - source => 'git://example.com/repo.git', - revision => '0c466b8a5a45f6cd7de82c08df2fb4ce1e920a31', - } - -**Tag** - - vcsrepo { "/path/to/repo": - ensure => present, - provider => git, - source => 'git://example.com/repo.git', - revision => '1.1.2rc1', - } - -**Branch name** - - vcsrepo { "/path/to/repo": - ensure => present, - provider => git, - source => 'git://example.com/repo.git', - revision => 'development', - } - -To check out a branch as a specific user, - - vcsrepo { "/path/to/repo": - ensure => present, - provider => git, - source => 'git://example.com/repo.git', - revision => '0c466b8a5a45f6cd7de82c08df2fb4ce1e920a31', - user => 'someUser', - } - -To keep the repository at the latest revision (**WARNING:** this will always overwrite local changes to the repository), - - vcsrepo { "/path/to/repo": - ensure => latest, - provider => git, - source => 'git://example.com/repo.git', - revision => 'master', - } - -#####Sources that use SSH - -When your source uses SSH, such as 'username@server:…', you can manage your SSH keys with Puppet using the [require](http://docs.puppetlabs.com/references/stable/metaparameter.html#require) metaparameter in `vcsrepo` to ensure they are present. - -For SSH keys associated with a user, enter the username in the `user` parameter. Doing so will use that user's keys. - - user => 'toto' # will use toto's $HOME/.ssh setup - -#####Further Examples - -For more examples using Git, see `examples/git/`. - ###Mercurial #####To create a blank repository @@ -374,10 +377,10 @@ The vcsrepo module is slightly unusual in that it is simply a type and providers **Note**: Not all features are available with all providers. +* `git` - Supports the Git VCS. (Contains features: `bare_repositories`, `depth`, `multiple_remotes`, `reference_tracking`, `ssh_identity`, `user`.) * `bar` - Supports the Bazaar VCS. (Contains features: `reference_tracking`.) * `cvs` - Supports the CVS VCS. (Contains features: `cvs_rsh`, `gzip_compression`, `modules`,`reference_tracking`.) * `dummy` - -* `git` - Supports the Git VCS. (Contains features: `bare_repositories`, `depth`, `multiple_remotes`, `reference_tracking`, `ssh_identity`, `user`.) * `hg` - Supports the Mercurial VCS. (Contains features: `reference_tracking`, `ssh_identity`, `user`.) * `svn` - Supports the Subversion VCS. (Contains features: `basic_auth`, `configuration`, `filesystem_types`, `reference_tracking`.) @@ -423,6 +426,11 @@ The vcsrepo module is slightly unusual in that it is simply a type and providers ####Features and Parameters by Provider +#####`git` +**Features**: `bare_repositories`, `depth`, `multiple_remotes`, `reference_tracking`, `ssh_identity`, `user` + +**Parameters**: `depth`, `ensure`, `excludes`, `force`, `group`, `identity`, `owner`, `path`, `provider`, `remote`, `revision`, `source`, `user` + #####`bzr` **Features**: `reference_tracking` @@ -433,11 +441,6 @@ The vcsrepo module is slightly unusual in that it is simply a type and providers **Parameters**: `compression`, `cvs_rsh`, `ensure`, `excludes`, `force`, `group`, `module`, `owner`, `path`, `provider`, `revision`, `source`, `user` -#####`git` -**Features**: `bare_repositories`, `depth`, `multiple_remotes`, `reference_tracking`, `ssh_identity`, `user` - -**Parameters**: `depth`, `ensure`, `excludes`, `force`, `group`, `identity`, `owner`, `path`, `provider`, `remote`, `revision`, `source`, `user` - #####`hg` **Features**: `reference_tracking`, `ssh_identity`, `user` @@ -450,6 +453,8 @@ The vcsrepo module is slightly unusual in that it is simply a type and providers ##Limitations +Git is the only VCS provider officially [supported](https://forge.puppetlabs.com/supported) by Puppet Labs. + This module has been built on and tested against Puppet 2.7 and higher. The module has been tested on: -- cgit v1.2.3 From 34cc0c0d4e35fdc5a7b8381033886d160927d501 Mon Sep 17 00:00:00 2001 From: Paul Allen Date: Wed, 2 Jul 2014 12:05:35 +0100 Subject: Update Markdown with missing Perforce details. Fix tabs/spaces in p4.rb --- README.markdown | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'README.markdown') diff --git a/README.markdown b/README.markdown index f83c7fd..7ce9657 100644 --- a/README.markdown +++ b/README.markdown @@ -459,6 +459,7 @@ The vcsrepo module is slightly unusual in that it is simply a type and providers * `cvs` - Supports the CVS VCS. (Contains features: `cvs_rsh`, `gzip_compression`, `modules`,`reference_tracking`.) * `dummy` - * `hg` - Supports the Mercurial VCS. (Contains features: `reference_tracking`, `ssh_identity`, `user`.) +* `p4` - Supports the Perforce VCS. (Contains features: `reference_tracking`, `filesystem_types`, `p4config`.) * `svn` - Supports the Subversion VCS. (Contains features: `basic_auth`, `configuration`, `filesystem_types`, `reference_tracking`.) ####Features @@ -477,6 +478,7 @@ The vcsrepo module is slightly unusual in that it is simply a type and providers * `reference_tracking` - The provider supports tracking revision references that can change over time (e.g. some VCS tags and branch names). (Available with `bar`, `cvs`, `git`, `hg`, `svn`.) * `ssh_identity` - The provider supports a configurable SSH identity file. (Available with `git` and `hg`.) * `user` - The provider can run as a different user. (Available with `git` and `hg`.) +* `p4config` - The provider support setting the P4CONFIG environment. (Available with `p4`.) ####Parameters @@ -494,12 +496,13 @@ The vcsrepo module is slightly unusual in that it is simply a type and providers * `identity` - Specifies the SSH identity file. (Requires the `ssh_identity` feature.) * `module` - Specifies the repository module to manage. (Requires the `modules` feature.) * `owner` - Specifies the user/uid that owns the repository files. -* `path` - Specifies the absolute path to the repository. If omitted, the value defaults to the resource's title. +* `path` - Specifies the absolute path to the repository. If omitted, the value defaults to the resource's title. * `provider` - Specifies the backend to use for this vcsrepo resource. * `remote` - Specifies the remote repository to track. (Requires the `multiple_remotes` feature.) * `revision` - Sets the revision of the repository. Values can match /^\S+$/. * `source` - Specifies the source URI for the repository. * `user` - Specifies the user to run as for repository operations. +* `p4config` - Specifies the P4CONFIG environment used for Perforce connection configuration. ####Features and Parameters by Provider @@ -523,6 +526,11 @@ The vcsrepo module is slightly unusual in that it is simply a type and providers **Parameters**: `ensure`, `excludes`, `force`, `group`, `identity`, `owner`, `path`, `provider`, `revision`, `source`, `user` +#####`p4` +**Features**: `reference_tracking`, `filesystem_types`, `p4config` + +**Parameters**: `ensure`, `group`, `owner`, `path`, `provider`, `revision`, `source`, `p4config` + #####`svn` **Features**: `basic_auth`, `configuration`, `filesystem_types`, `reference_tracking` -- cgit v1.2.3 From 1578537eed7f48f40d31f5379fc5b64bdbe50c4f Mon Sep 17 00:00:00 2001 From: Klynton Jessup Date: Wed, 9 Jul 2014 16:28:08 -0700 Subject: Update README.markdown Fixed a missing '*' around the note. --- README.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README.markdown') diff --git a/README.markdown b/README.markdown index f83c7fd..570f166 100644 --- a/README.markdown +++ b/README.markdown @@ -61,7 +61,7 @@ The vcsrepo module works with the following VCSs: * [Perforce (p4)](#perforce) * [Subversion (svn)](#subversion) -**Note:* Git is the only VCS provider officially [supported](https://forge.puppetlabs.com/supported) by Puppet Labs. +**Note:** Git is the only VCS provider officially [supported](https://forge.puppetlabs.com/supported) by Puppet Labs. ###Git -- cgit v1.2.3 From ecf02352a371e3c4a9c72bf94297f047bc400aa7 Mon Sep 17 00:00:00 2001 From: Jon Fautley Date: Tue, 28 Oct 2014 16:21:48 +0000 Subject: Add `user` feature support to CVS provider --- README.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'README.markdown') diff --git a/README.markdown b/README.markdown index 6d03a7c..de6ae9a 100644 --- a/README.markdown +++ b/README.markdown @@ -456,7 +456,7 @@ The vcsrepo module is slightly unusual in that it is simply a type and providers * `git` - Supports the Git VCS. (Contains features: `bare_repositories`, `depth`, `multiple_remotes`, `reference_tracking`, `ssh_identity`, `user`.) * `bar` - Supports the Bazaar VCS. (Contains features: `reference_tracking`.) -* `cvs` - Supports the CVS VCS. (Contains features: `cvs_rsh`, `gzip_compression`, `modules`,`reference_tracking`.) +* `cvs` - Supports the CVS VCS. (Contains features: `cvs_rsh`, `gzip_compression`, `modules`, `reference_tracking`, `user`.) * `dummy` - * `hg` - Supports the Mercurial VCS. (Contains features: `reference_tracking`, `ssh_identity`, `user`.) * `p4` - Supports the Perforce VCS. (Contains features: `reference_tracking`, `filesystem_types`, `p4config`.) @@ -477,7 +477,7 @@ The vcsrepo module is slightly unusual in that it is simply a type and providers * `multiple_remotes` - The repository tracks multiple remote repositories. (Available with `git`.) * `reference_tracking` - The provider supports tracking revision references that can change over time (e.g. some VCS tags and branch names). (Available with `bar`, `cvs`, `git`, `hg`, `svn`.) * `ssh_identity` - The provider supports a configurable SSH identity file. (Available with `git` and `hg`.) -* `user` - The provider can run as a different user. (Available with `git` and `hg`.) +* `user` - The provider can run as a different user. (Available with `git`, `hg` and `cvs`.) * `p4config` - The provider support setting the P4CONFIG environment. (Available with `p4`.) ####Parameters -- cgit v1.2.3 From 2055ea138a8af3dcc3c077687fc216c20bb2a65e Mon Sep 17 00:00:00 2001 From: Morgan Haskel Date: Mon, 3 Nov 2014 14:20:15 -0800 Subject: Add missing doc update. --- README.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README.markdown') diff --git a/README.markdown b/README.markdown index de6ae9a..08b8865 100644 --- a/README.markdown +++ b/README.markdown @@ -489,7 +489,7 @@ The vcsrepo module is slightly unusual in that it is simply a type and providers * `cvs_rsh` - The value to be used for the CVS_RSH environment variable. (Requires the `cvs_rsh` feature.) * `depth` - The value to be used to do a shallow clone. (Requires the `depth` feature.) * `ensure` - Determines the state of the repository. Valid values are 'present', 'bare', 'absent', 'latest'. -* `excludes` - Lists any files to be excluded from the repository. +* `excludes` - Lists any files to be excluded from the repository. Can be an array or string. * `force` - Forces repository creation. Valid values are 'true' and 'false'. **WARNING** Forcing will destroy any files in the path. * `fstype` - Sets the filesystem type. (Requires the `filesystem_types` feature.) * `group` - Determines the group/gid that owns the repository files. -- cgit v1.2.3 From ec7cb205f9b6c7aa82621e0c3143dc0ecb6457b6 Mon Sep 17 00:00:00 2001 From: Lauren Rother Date: Thu, 20 Nov 2014 11:57:00 -0800 Subject: Updates README per MODULES-1425 Adds note to Setup section stating that the module will not create parent directories or install VCS software. --- README.markdown | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'README.markdown') diff --git a/README.markdown b/README.markdown index 08b8865..cefa50b 100644 --- a/README.markdown +++ b/README.markdown @@ -41,6 +41,10 @@ This module provides a single type with providers for each VCS, which can be use ##Setup +Before you begin using vcsrepo, it's worth keeping in mind that this module will not install VCS software for you. If you are going to use this module, you must have already installed your preferred VCS. + +Also, this module, like Puppet generally, will not create parent directories for you. You will need to have your parent directories in place before you begin. + ###Beginning with vcsrepo To get started with the vcsrepo module, you must simply define the type `vcsrepo` with a path to your repository and the [type of VCS](#Usage) you're using in `provider` (in the below example, Git). -- cgit v1.2.3 From dfe5f9cc316a43793da2cb1c4adbc66503907460 Mon Sep 17 00:00:00 2001 From: dduvnjak Date: Sun, 18 Jan 2015 10:49:03 +0100 Subject: Add submodules feature to git provider --- README.markdown | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'README.markdown') diff --git a/README.markdown b/README.markdown index 08b8865..062f0f7 100644 --- a/README.markdown +++ b/README.markdown @@ -141,6 +141,15 @@ To keep the repository at the latest revision (**WARNING:** this will always ove revision => 'master', } +To clone the repository but skip initialiazing submodules, + + vcsrepo { "/path/to/repo": + ensure => latest, + provider => git, + source => 'git://example.com/repo.git', + submodules => false, + } + #####Sources that use SSH When your source uses SSH, such as 'username@server:…', you can manage your SSH keys with Puppet using the [require](http://docs.puppetlabs.com/references/stable/metaparameter.html#require) metaparameter in `vcsrepo` to ensure they are present. @@ -479,6 +488,7 @@ The vcsrepo module is slightly unusual in that it is simply a type and providers * `ssh_identity` - The provider supports a configurable SSH identity file. (Available with `git` and `hg`.) * `user` - The provider can run as a different user. (Available with `git`, `hg` and `cvs`.) * `p4config` - The provider support setting the P4CONFIG environment. (Available with `p4`.) +* `submodules` - The provider supports repository submodules which can be optionally initialized. (Available with `git`.) ####Parameters @@ -507,9 +517,9 @@ The vcsrepo module is slightly unusual in that it is simply a type and providers ####Features and Parameters by Provider #####`git` -**Features**: `bare_repositories`, `depth`, `multiple_remotes`, `reference_tracking`, `ssh_identity`, `user` +**Features**: `bare_repositories`, `depth`, `multiple_remotes`, `reference_tracking`, `ssh_identity`, `user`, `submodules` -**Parameters**: `depth`, `ensure`, `excludes`, `force`, `group`, `identity`, `owner`, `path`, `provider`, `remote`, `revision`, `source`, `user` +**Parameters**: `depth`, `ensure`, `excludes`, `force`, `group`, `identity`, `owner`, `path`, `provider`, `remote`, `revision`, `source`, `user`, `submodules` #####`bzr` **Features**: `reference_tracking` -- cgit v1.2.3 From 5d6ef988af1ff90b4625b0426301cb6fad0268b8 Mon Sep 17 00:00:00 2001 From: Jonathan Tripathy Date: Tue, 20 Jan 2015 23:12:20 -0800 Subject: Implemented multiple remotes feature for git provider. --- README.markdown | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'README.markdown') diff --git a/README.markdown b/README.markdown index 6c6f0a5..34a51e2 100644 --- a/README.markdown +++ b/README.markdown @@ -154,6 +154,20 @@ To clone the repository but skip initialiazing submodules, submodules => false, } +##### Using multiple remotes with a repository +Instead of specifying a single string in the 'source' property, you can specify a hash with multiple name => URL mappings, + + vcsrepo { "/path/to/repo": + ensure => present, + provider => git, + source => { + "origin" => "https://github.com/puppetlabs/puppetlabs-vcsrepo.git", + "other_remote" => "https://github.com/other_user/puppetlabs-vcsrepo.git" + }, + } + +It is important to note that you must specify a mapping for the remote that is specified in the 'remote' property - this is set to 'origin' by default. + #####Sources that use SSH When your source uses SSH, such as 'username@server:…', you can manage your SSH keys with Puppet using the [require](http://docs.puppetlabs.com/references/stable/metaparameter.html#require) metaparameter in `vcsrepo` to ensure they are present. -- cgit v1.2.3 From 6bf794483ac41d2cffebec338eb926682897cef8 Mon Sep 17 00:00:00 2001 From: Ricky Ng Date: Thu, 12 Feb 2015 14:49:41 -0600 Subject: Update README.markdown Clarified what the parameter 'excludes' is intended to do. --- README.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README.markdown') diff --git a/README.markdown b/README.markdown index 34a51e2..9671fc5 100644 --- a/README.markdown +++ b/README.markdown @@ -517,7 +517,7 @@ The vcsrepo module is slightly unusual in that it is simply a type and providers * `cvs_rsh` - The value to be used for the CVS_RSH environment variable. (Requires the `cvs_rsh` feature.) * `depth` - The value to be used to do a shallow clone. (Requires the `depth` feature.) * `ensure` - Determines the state of the repository. Valid values are 'present', 'bare', 'absent', 'latest'. -* `excludes` - Lists any files to be excluded from the repository. Can be an array or string. +* `excludes` - Lists any files to be excluded from being tracked by the repository (similiar to .gitignore). Can be an array or string. * `force` - Forces repository creation. Valid values are 'true' and 'false'. **WARNING** Forcing will destroy any files in the path. * `fstype` - Sets the filesystem type. (Requires the `filesystem_types` feature.) * `group` - Determines the group/gid that owns the repository files. -- cgit v1.2.3 From c858962ef98782f261043c4d5d6dd2ab182afaec Mon Sep 17 00:00:00 2001 From: Rob Nelson Date: Tue, 14 Apr 2015 21:29:37 +0000 Subject: Enforce the style guide's recommendation of single quotes as the default. --- README.markdown | 108 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 54 insertions(+), 54 deletions(-) (limited to 'README.markdown') diff --git a/README.markdown b/README.markdown index 9671fc5..2433d99 100644 --- a/README.markdown +++ b/README.markdown @@ -49,7 +49,7 @@ Also, this module, like Puppet generally, will not create parent directories for To get started with the vcsrepo module, you must simply define the type `vcsrepo` with a path to your repository and the [type of VCS](#Usage) you're using in `provider` (in the below example, Git). - vcsrepo { "/path/to/repo": + vcsrepo { '/path/to/repo': ensure => present, provider => git, } @@ -75,14 +75,14 @@ The vcsrepo module works with the following VCSs: To create a blank repository suitable for use as a central repository, define `vcsrepo` without `source` or `revision`. - vcsrepo { "/path/to/repo": + vcsrepo { '/path/to/repo': ensure => present, provider => git, } If you're defining `vcsrepo` for a central or official repository, you may want to make it a bare repository. You do this by setting `ensure` to 'bare' rather than 'present'. - vcsrepo { "/path/to/repo": + vcsrepo { '/path/to/repo': ensure => bare, provider => git, } @@ -91,17 +91,17 @@ If you're defining `vcsrepo` for a central or official repository, you may want To get the current HEAD on the master branch, - vcsrepo { "/path/to/repo": + vcsrepo { '/path/to/repo': ensure => present, provider => git, - source => "git://example.com/repo.git", + source => 'git://example.com/repo.git', } To get a specific revision or branch (can be a commit SHA, tag, or branch name), **SHA** - vcsrepo { "/path/to/repo": + vcsrepo { '/path/to/repo': ensure => present, provider => git, source => 'git://example.com/repo.git', @@ -110,7 +110,7 @@ To get a specific revision or branch (can be a commit SHA, tag, or branch name), **Tag** - vcsrepo { "/path/to/repo": + vcsrepo { '/path/to/repo': ensure => present, provider => git, source => 'git://example.com/repo.git', @@ -119,7 +119,7 @@ To get a specific revision or branch (can be a commit SHA, tag, or branch name), **Branch name** - vcsrepo { "/path/to/repo": + vcsrepo { '/path/to/repo': ensure => present, provider => git, source => 'git://example.com/repo.git', @@ -128,7 +128,7 @@ To get a specific revision or branch (can be a commit SHA, tag, or branch name), To check out a branch as a specific user, - vcsrepo { "/path/to/repo": + vcsrepo { '/path/to/repo': ensure => present, provider => git, source => 'git://example.com/repo.git', @@ -138,7 +138,7 @@ To check out a branch as a specific user, To keep the repository at the latest revision (**WARNING:** this will always overwrite local changes to the repository), - vcsrepo { "/path/to/repo": + vcsrepo { '/path/to/repo': ensure => latest, provider => git, source => 'git://example.com/repo.git', @@ -147,7 +147,7 @@ To keep the repository at the latest revision (**WARNING:** this will always ove To clone the repository but skip initialiazing submodules, - vcsrepo { "/path/to/repo": + vcsrepo { '/path/to/repo': ensure => latest, provider => git, source => 'git://example.com/repo.git', @@ -157,12 +157,12 @@ To clone the repository but skip initialiazing submodules, ##### Using multiple remotes with a repository Instead of specifying a single string in the 'source' property, you can specify a hash with multiple name => URL mappings, - vcsrepo { "/path/to/repo": + vcsrepo { '/path/to/repo': ensure => present, provider => git, source => { - "origin" => "https://github.com/puppetlabs/puppetlabs-vcsrepo.git", - "other_remote" => "https://github.com/other_user/puppetlabs-vcsrepo.git" + origin => 'https://github.com/puppetlabs/puppetlabs-vcsrepo.git', + other_remote => 'https://github.com/other_user/puppetlabs-vcsrepo.git' }, } @@ -187,7 +187,7 @@ For more examples using Git, see `examples/git/`. To create a blank repository suitable for use as a central repository, define `vcsrepo` without `source` or `revision`. - vcsrepo { "/path/to/repo": + vcsrepo { '/path/to/repo': ensure => present, provider => bzr, } @@ -196,7 +196,7 @@ define `vcsrepo` without `source` or `revision`. Provide the `source` location to branch from an existing repository. - vcsrepo { "/path/to/repo": + vcsrepo { '/path/to/repo': ensure => present, provider => bzr, source => 'lp:myproj', @@ -205,7 +205,7 @@ Provide the `source` location to branch from an existing repository. For a specific revision, use `revision` with a valid revisionspec (see `bzr help revisionspec` for more information on formatting a revision). - vcsrepo { "/path/to/repo": + vcsrepo { '/path/to/repo': ensure => present, provider => bzr, source => 'lp:myproj', @@ -228,7 +228,7 @@ For more examples using Bazaar, see `examples/bzr/`. To create a blank repository suitable for use as a central repository, define `vcsrepo` without `source` or `revision`. - vcsrepo { "/path/to/repo": + vcsrepo { '/path/to/repo': ensure => present, provider => cvs, } @@ -237,39 +237,39 @@ define `vcsrepo` without `source` or `revision`. To get the current mainline, - vcsrepo { "/path/to/workspace": + vcsrepo { '/path/to/workspace': ensure => present, provider => cvs, - source => ":pserver:anonymous@example.com:/sources/myproj", + source => ':pserver:anonymous@example.com:/sources/myproj', } To get a specific module on the current mainline, - vcsrepo {"/vagrant/lockss-daemon-source": + vcsrepo {'/vagrant/lockss-daemon-source': ensure => present, provider => cvs, - source => ":pserver:anonymous@lockss.cvs.sourceforge.net:/cvsroot/lockss", - module => "lockss-daemon", + source => ':pserver:anonymous@lockss.cvs.sourceforge.net:/cvsroot/lockss', + module => 'lockss-daemon', } You can use the `compression` parameter to set the GZIP compression levels for your repository history. - vcsrepo { "/path/to/workspace": + vcsrepo { '/path/to/workspace': ensure => present, provider => cvs, compression => 3, - source => ":pserver:anonymous@example.com:/sources/myproj", + source => ':pserver:anonymous@example.com:/sources/myproj', } For a specific tag, use `revision`. - vcsrepo { "/path/to/workspace": + vcsrepo { '/path/to/workspace': ensure => present, provider => cvs, compression => 3, - source => ":pserver:anonymous@example.com:/sources/myproj", - revision => "SOMETAG", + source => ':pserver:anonymous@example.com:/sources/myproj', + revision => 'SOMETAG', } #####Sources that use SSH @@ -287,7 +287,7 @@ For for more examples using CVS, see `examples/cvs/`. To create a blank repository suitable for use as a central repository, define `vcsrepo` without `source` or `revision`. - vcsrepo { "/path/to/repo": + vcsrepo { '/path/to/repo': ensure => present, provider => hg, } @@ -296,51 +296,51 @@ define `vcsrepo` without `source` or `revision`. To get the default branch tip, - vcsrepo { "/path/to/repo": + vcsrepo { '/path/to/repo': ensure => present, provider => hg, - source => "http://hg.example.com/myrepo", + source => 'http://hg.example.com/myrepo', } For a specific changeset, use `revision`. - vcsrepo { "/path/to/repo": + vcsrepo { '/path/to/repo': ensure => present, provider => hg, - source => "http://hg.example.com/myrepo", + source => 'http://hg.example.com/myrepo', revision => '21ea4598c962', } You can also set `revision` to a tag. - vcsrepo { "/path/to/repo": + vcsrepo { '/path/to/repo': ensure => present, provider => hg, - source => "http://hg.example.com/myrepo", + source => 'http://hg.example.com/myrepo', revision => '1.1.2', } To check out as a specific user, - vcsrepo { "/path/to/repo": + vcsrepo { '/path/to/repo': ensure => present, provider => hg, - source => "http://hg.example.com/myrepo", + source => 'http://hg.example.com/myrepo', user => 'user', } To specify an SSH identity key, - vcsrepo { "/path/to/repo": + vcsrepo { '/path/to/repo': ensure => present, provider => hg, - source => "ssh://hg@hg.example.com/myrepo", - identity => "/home/user/.ssh/id_dsa, + source => 'ssh://hg@hg.example.com/myrepo', + identity => '/home/user/.ssh/id_dsa', } To specify a username and password for HTTP Basic authentication, - vcsrepo { "/path/to/repo": + vcsrepo { '/path/to/repo': ensure => latest, provider => hg, source => 'http://hg.example.com/myrepo', @@ -364,7 +364,7 @@ To create an empty Workspace, define a `vcsrepo` without a `source` or `revision Environment variables P4PORT, P4USER, etc... are used to define the Perforce server connection settings. - vcsrepo { "/path/to/repo": + vcsrepo { '/path/to/repo': ensure => present, provider => p4 } @@ -378,7 +378,7 @@ A Perforce configuration file can be used by setting the `P4CONFIG` environment defining `p4config`. If a configuration is defined, then the environment variable for `P4CLIENT` is replaced. - vcsrepo { "/path/to/repo": + vcsrepo { '/path/to/repo': ensure => present, provider => p4, p4config => '.p4config' @@ -388,7 +388,7 @@ defining `p4config`. If a configuration is defined, then the environment variab To sync a depot path to head, ensure `latest`: - vcsrepo { "/path/to/repo": + vcsrepo { '/path/to/repo': ensure => latest, provider => p4, source => '//depot/branch/...' @@ -396,7 +396,7 @@ To sync a depot path to head, ensure `latest`: For a specific changelist, ensure `present` and specify a `revision`: - vcsrepo { "/path/to/repo": + vcsrepo { '/path/to/repo': ensure => present, provider => p4, source => '//depot/branch/...', @@ -405,7 +405,7 @@ For a specific changelist, ensure `present` and specify a `revision`: You can also set `revision` to a label: - vcsrepo { "/path/to/repo": + vcsrepo { '/path/to/repo': ensure => present, provider => p4, source => '//depot/branch/...', @@ -428,7 +428,7 @@ For examples you can run, see `examples/p4/` To create a blank repository suitable for use as a central repository, define `vcsrepo` without `source` or `revision`. - vcsrepo { "/path/to/repo": + vcsrepo { '/path/to/repo': ensure => present, provider => svn, } @@ -437,18 +437,18 @@ define `vcsrepo` without `source` or `revision`. Provide a `source` pointing to the branch/tag you want to check out from a repository. - vcsrepo { "/path/to/repo": + vcsrepo { '/path/to/repo': ensure => present, provider => svn, - source => "svn://svnrepo/hello/branches/foo", + source => 'svn://svnrepo/hello/branches/foo', } You can also provide a specific revision. - vcsrepo { "/path/to/repo": + vcsrepo { '/path/to/repo': ensure => present, provider => svn, - source => "svn://svnrepo/hello/branches/foo", + source => 'svn://svnrepo/hello/branches/foo', revision => '1234', } @@ -456,11 +456,11 @@ You can also provide a specific revision. To use a specific configuration directory, provide a `configuration` parameter which should be a directory path on the local system where your svn configuration files are. Typically, it is '/path/to/.subversion'. - vcsrepo { "/path/to/repo": + vcsrepo { '/path/to/repo': ensure => present, provider => svn, - source => "svn://svnrepo/hello/branches/foo", - configuration => "/path/to/.subversion", + source => 'svn://svnrepo/hello/branches/foo', + configuration => '/path/to/.subversion', } #####Sources that use SSH -- cgit v1.2.3 From b1e0a48fa095aac7d2aea01f616a164890a10c2d Mon Sep 17 00:00:00 2001 From: Pete Soloway Date: Tue, 7 Apr 2015 09:56:10 -0700 Subject: Update README per DOC-1501 1. Remove any "what this affects" sections, except where particularly warranted. 2. Make sure that for each parameter, where applicable, there is a data type and a default value. 3. Make sure that for each parameter that's applicable, there is a note if the parameter is optional. 4. Make sure the links in the README work and are accurate. 5. Update the link in the Contributing section to point here: https://docs.puppetlabs.com/forge/contributing.html 6. General copyediting. --- README.markdown | 1232 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 690 insertions(+), 542 deletions(-) (limited to 'README.markdown') diff --git a/README.markdown b/README.markdown index 9671fc5..924a317 100644 --- a/README.markdown +++ b/README.markdown @@ -1,591 +1,739 @@ -#vcsrepo +#vcsrepo + +####Table of Contents + +1. [Overview](#overview) +2. [Module Description - What the module does and why it is useful](#module-description) +3. [Setup - The basics of getting started with vcsrepo](#setup) + * [Setup requirements](#setup-requirements) + * [Beginning with vcsrepo](#beginning-with-vcsrepo) +4. [Usage - Configuration options and additional functionality](#usage) + * [Git](#git) + * [Bazaar](#bazaar) + * [CVS](#cvs) + * [Mercurial](#mercurial) + * [Perforce](#perforce) + * [Subversion](#subversion) +5. [Reference - An under-the-hood peek at what the module is doing and how](#reference) + * [Type: vcsrepo](#type-vcsrepo) + * [Providers](#providers) + * [Features](#features) + * [Parameters](#parameters) +5. [Limitations - OS compatibility, etc.](#limitations) +6. [Development - Guide for contributing to the module](#development) + +##Overview + +The vcsrepo module lets you use Puppet to easily deploy content from your version control system (VCS). + +##Module Description + +The vcsrepo module provides a single type with providers to support the following version control systems: + +* [Git](#git) +* [Bazaar](#bazaar) +* [CVS](#cvs) +* [Mercurial](#mercurial) +* [Perforce](#perforce) +* [Subversion](#subversion) + +**Note:** `git` is the only vcs provider officially [supported by Puppet Labs](https://forge.puppetlabs.com/supported). + +##Setup + +###Setup Requirements + +The `vcsrepo` module does not install any VCS software for you. You must install a VCS before you can use this module. + +Like Puppet in general, the `vcsrepo` module does not automatically create parent directories for the files it manages. Make sure to set up any needed directory structures before you get started. + +###Beginning with vcsrepo + +To create and manage a blank repository, define the type `vcsrepo` with a path to your repository and supply the `provider` parameter based on the [VCS you're using](#usage). + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => git, +} +~~~ + +##Usage + +**Note:** `git` is the only vcsrepo provider officially [supported by Puppet Labs](https://forge.puppetlabs.com/supported). + +###Git + +####Create a blank repository + +To create a blank repository, suitable for use as a central repository, define `vcsrepo` without `source` or `revision`: + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => git, +} +~~~ + +If you're managing a central or official repository, you might want to make it a bare repository. To do this, set `ensure` to 'bare': + +~~~ +vcsrepo { '/path/to/repo': + ensure => bare, + provider => git, +} +~~~ + +####Clone/pull a repository + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => git, + source => 'git://example.com/repo.git', +} +~~~ + +By default, `vcsrepo` will use the HEAD of the source repository's master branch. To use another branch or a specific commit, set `revision` to either a branch name or a commit SHA or tag. + +Branch name: + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => git, + source => 'git://example.com/repo.git', + revision => 'development', +} +~~~ + +SHA: + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => git, + source => 'git://example.com/repo.git', + revision => '0c466b8a5a45f6cd7de82c08df2fb4ce1e920a31', +} +~~~ + +Tag: + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => git, + source => 'git://example.com/repo.git', + revision => '1.1.2rc1', +} +~~~ + +To check out a branch as a specific user, supply the `user` parameter: + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => git, + source => 'git://example.com/repo.git', + revision => '0c466b8a5a45f6cd7de82c08df2fb4ce1e920a31', + user => 'someUser', +} +~~~ + +To keep the repository at the latest revision, set `ensure` to 'latest'. + +**WARNING:** this overwrites any local changes to the repository: + +~~~ +vcsrepo { '/path/to/repo': + ensure => latest, + provider => git, + source => 'git://example.com/repo.git', + revision => 'master', +} +~~~ + +To clone the repository but skip initializing submodules, set `submodules` to 'false': + +~~~ +vcsrepo { '/path/to/repo': + ensure => latest, + provider => git, + source => 'git://example.com/repo.git', + submodules => false, +} +~~~ + +####Use multiple remotes with a repository +In place of a single string, you can set `source` to a hash of one or more name => URL pairs: + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => git, + remote => 'origin' + source => { + 'origin' => 'https://github.com/puppetlabs/puppetlabs-vcsrepo.git', + 'other_remote' => 'https://github.com/other_user/puppetlabs-vcsrepo.git' + }, +} +~~~ + +**Note:** if you set `source` to a hash, one of the names you specify must match the value of the `remote` parameter. That remote serves as the upstream of your managed repository. + +####Connect via SSH + +To connect to your source repository via SSH (e.g., 'username@server:…'), we recommend managing your SSH keys with Puppet and using the [`require`](http://docs.puppetlabs.com/references/stable/metaparameter.html#require) metaparameter to make sure they are present before the `vcsrepo` resource is applied. + +To use SSH keys associated with a user, specify the username in the `user` parameter: + +~~~ +vcsrepo { '/path/to/repo': + ensure => latest, + provider => git, + source => 'git://username@example.com/repo.git', + user => 'toto', #uses toto's $HOME/.ssh setup + require => File['/home/toto/.ssh/id_rsa'], +} +~~~ + +###Bazaar + +####Create a blank repository + +To create a blank repository, suitable for use as a central repository, define `vcsrepo` without `source` or `revision`: + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => bzr, +} +~~~ + +####Branch from an existing repository + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => bzr, + source => '/some/path', +} +~~~ + +To branch from a specific revision, set `revision` to a valid [Bazaar revisionspec](http://wiki.bazaar.canonical.com/BzrRevisionSpec): + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => bzr, + source => '/some/path', + revision => 'menesis@pov.lt-20100309191856-4wmfqzc803fj300x', +} +~~~ + +####Connect via SSH + +To connect to your source repository via SSH (e.g., `'bzr+ssh://...'` or `'sftp://...,'`), we recommend using the [`require`](http://docs.puppetlabs.com/references/stable/metaparameter.html#require) metaparameter to make sure your SSH keys are present before the `vcsrepo` resource is applied: + +~~~ +vcsrepo { '/path/to/repo': + ensure => latest, + provider => bzr, + source => 'bzr+ssh://bzr.example.com/some/path', + user => 'toto', #uses toto's $HOME/.ssh setup + require => File['/home/toto/.ssh/id_rsa'], +} +~~~ + +###CVS + +####Create a blank repository + +To create a blank repository, suitable for use as a central repository, define `vcsrepo` without `source` or `revision`: + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => cvs, +} +~~~ + +####Checkout/update from a repository + +~~~ +vcsrepo { '/path/to/workspace': + ensure => present, + provider => cvs, + source => ':pserver:anonymous@example.com:/sources/myproj', +} +~~~ + +To get a specific module on the current mainline, supply the `module` parameter: + +~~~ +vcsrepo {'/vagrant/lockss-daemon-source': + ensure => present, + provider => cvs, + source => ':pserver:anonymous@lockss.cvs.sourceforge.net:/cvsroot/lockss', + module => 'lockss-daemon', +} +~~~ + +To set the GZIP compression levels for your repository history, use the `compression` parameter: + +~~~ +vcsrepo { '/path/to/workspace': + ensure => present, + provider => cvs, + compression => 3, + source => ':pserver:anonymous@example.com:/sources/myproj', +} +~~~ + +To get a specific revision, set `revision` to the revision number. + +~~~ +vcsrepo { '/path/to/workspace': + ensure => present, + provider => cvs, + compression => 3, + source => ':pserver:anonymous@example.com:/sources/myproj', + revision => '1.2', +} +~~~ + +You can also set `revision` to a tag: + +~~~ +vcsrepo { '/path/to/workspace': + ensure => present, + provider => cvs, + compression => 3, + source => ':pserver:anonymous@example.com:/sources/myproj', + revision => 'SOMETAG', +} +~~~ + +####Connect via SSH + +To connect to your source repository via SSH, we recommend using the [`require`](http://docs.puppetlabs.com/references/stable/metaparameter.html#require) metaparameter to make sure your SSH keys are present before the `vcsrepo` resource is applied: + +~~~ +vcsrepo { '/path/to/repo': + ensure => latest, + provider => cvs, + source => ':pserver:anonymous@example.com:/sources/myproj', + user => 'toto', #uses toto's $HOME/.ssh setup + require => File['/home/toto/.ssh/id_rsa'], +} +~~~ + +###Mercurial + +####Create a blank repository + +To create a blank repository, suitable for use as a central repository, define `vcsrepo` without `source` or `revision`: + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => hg, +} +~~~ + +####Clone/pull & update a repository + +To get the default branch tip: + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => hg, + source => 'http://hg.example.com/myrepo', +} +~~~ + +For a specific changeset, use `revision`: + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => hg, + source => 'http://hg.example.com/myrepo', + revision => '21ea4598c962', +} +~~~ + +You can also set `revision` to a tag: + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => hg, + source => 'http://hg.example.com/myrepo', + revision => '1.1.2', +} +~~~ + +To check out as a specific user: + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => hg, + source => 'http://hg.example.com/myrepo', + user => 'user', +} +~~~ + +To specify an SSH identity key: + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => hg, + source => 'ssh://hg@hg.example.com/myrepo', + identity => '/home/user/.ssh/id_dsa1, +} +~~~ + +To specify a username and password for HTTP Basic authentication: + +~~~ +vcsrepo { '/path/to/repo': + ensure => latest, + provider => hg, + source => 'http://hg.example.com/myrepo', + basic_auth_username => 'hgusername', + basic_auth_password => 'hgpassword', +} +~~~ + +####Connect via SSH + +To connect to your source repository via SSH (e.g., `'ssh://...'`), we recommend using the [`require` metaparameter](http://docs.puppetlabs.com/references/stable/metaparameter.html#require) to make sure your SSH keys are present before the `vcsrepo` resource is applied: + +~~~ +vcsrepo { '/path/to/repo': + ensure => latest, + provider => hg, + source => 'ssh://hg.example.com//path/to/myrepo', + user => 'toto', #uses toto's $HOME/.ssh setup + require => File['/home/toto/.ssh/id_rsa'], +} +~~~ + +###Perforce + +####Create an empty workspace + +To set up the connection to your Perforce service, set `p4config` to the location of a valid Perforce [config file](http://www.perforce.com/perforce/doc.current/manuals/p4guide/chapter.configuration.html#configuration.settings.configfiles) stored on the node: + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => p4, + p4config => '/root/.p4config' +} +~~~ + +**Note:** If you don't include the `P4CLIENT` setting in your config file, the provider generates a workspace name based on the digest of `path` and the node's hostname (e.g., `puppet-91bc00640c4e5a17787286acbe2c021c`): + +####Create/update and sync a Perforce workspace + +To sync a depot path to head, set `ensure` to 'latest': + +~~~ +vcsrepo { '/path/to/repo': + ensure => latest, + provider => p4, + source => '//depot/branch/...' +} +~~~ + +To sync to a specific changelist, specify its revision number with the `revision` parameter: + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => p4, + source => '//depot/branch/...', + revision => '2341' +} +~~~ + +You can also set `revision` to a label: + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => p4, + source => '//depot/branch/...', + revision => 'my_label' +} +~~~ + +###Subversion + +####Create a blank repository + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => svn, +} +~~~ + +####Check out from an existing repository + +Provide a `source` pointing to the branch or tag you want to check out: + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => svn, + source => 'svn://svnrepo/hello/branches/foo', +} +~~~ + +You can also designate a specific revision: + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => svn, + source => 'svn://svnrepo/hello/branches/foo', + revision => '1234', +} +~~~ + +####Use a specific Subversion configuration directory + +Use the `configuration` parameter to designate the directory that contains your Subversion configuration files (typically, '/path/to/.subversion'): + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => svn, + source => 'svn://svnrepo/hello/branches/foo', + configuration => '/path/to/.subversion', +} +~~~ + +####Connect via SSH + +To connect to your source repository via SSH (e.g., `'svn+ssh://...'`), we recommend using the [`require` metaparameter](http://docs.puppetlabs.com/references/stable/metaparameter.html#require) to make sure your SSH keys are present before the `vcsrepo` resource is applied: + +~~~ +vcsrepo { '/path/to/repo': + ensure => latest, + provider => svn, + source => 'svn+ssh://svnrepo/hello/branches/foo', + user => 'toto', #uses toto's $HOME/.ssh setup + require => File['/home/toto/.ssh/id_rsa'], +} +~~~ + +##Reference + +###Type: vcsrepo + +The vcsrepo module adds only one type with several providers. Each provider abstracts a different VCS, and each provider includes a set of features according to its needs. + +####Providers + +**Note:** Not all features are available with all providers. + +#####`git` - Supports the Git VCS. + +Features: `bare_repositories`, `depth`, `multiple_remotes`, `reference_tracking`, `ssh_identity`, `submodules`, `user` + +Parameters: `depth`, `ensure`, `excludes`, `force`, `group`, `identity`, `owner`, `path`, `provider`, `remote`, `revision`, `source`, `user` + +#####`bzr` - Supports the Bazaar VCS. + +Features: `reference_tracking` + +Parameters: `ensure`, `excludes`, `force`, `group`, `owner`, `path`, `provider`, `revision`, `source` + +#####`cvs` - Supports the CVS VCS. + +Features: `cvs_rsh`, `gzip_compression`, `modules`, `reference_tracking`, `user` + +Parameters: `compression`, `cvs_rsh`, `ensure`, `excludes`, `force`, `group`, `module`, `owner`, `path`, `provider` + +#####`hg` - Supports the Mercurial VCS. + +Features: `reference_tracking`, `ssh_identity`, `user` + +Parameters: `ensure`, `excludes`, `force`, `group`, `identity`, `owner`, `path`, `provider`, `revision`, `source`, `user` + +#####`p4` - Supports the Perforce VCS. + +Features: `p4config`, `reference_tracking` + +Parameters: `ensure`, `excludes`, `force`, `group`, `owner`, `p4config`, `path`, `provider`, `revision`, `source` + +#####`svn` - Supports the Subversion VCS. + +Features: `basic_auth`, `configuration`, `conflict`, `filesystem_types`, `reference_tracking` + +Parameters: `basic_auth_password`, `basic_auth_username`, `configuration`, `conflict`, `ensure`, `excludes`, `force`, `fstype`, `group`, `owner`, `path`, `provider`, `revision`, `source` + +####Features + +**Note:** Not all features are available with all providers. + +* `bare_repositories` - Differentiates between bare repositories and those with working copies. (Available with `git`.) +* `basic_auth` - Supports HTTP Basic authentication. (Available with `svn`.) +* `conflict` - Lets you decide how to resolve any conflicts between the source repository and your working copy. (Available with `svn`.) +* `configuration` - Lets you specify the location of your configuration files. (Available with `svn`.) +* `cvs_rsh` - Understands the `CVS_RSH` environment variable. (Available with `cvs`.) +* `depth` - Supports shallow clones. (Available with `git`.) +* `filesystem_types` - Supports multiple types of filesystem. (Available with `svn`.) +* `gzip_compression` - Supports explicit GZip compression levels. (Available with `cvs`.) +* `modules` - Lets you choose a specific repository module. (Available with `cvs`.) +* `multiple_remotes` - Tracks multiple remote repositories. (Available with `git`.) +* `reference_tracking` - Lets you track revision references that can change over time (e.g., some VCS tags and branch names). (Available with all providers) +* `ssh_identity` - Lets you specify an SSH identity file. (Available with `git` and `hg`.) +* `user` - Can run as a different user. (Available with `git`, `hg` and `cvs`.) +* `p4config` - Supports setting the `P4CONFIG` environment. (Available with `p4`.) +* `submodules` - Supports repository submodules which can be optionally initialized. (Available with `git`.) + +####Parameters + +All parameters are optional, except where specified otherwise. + +##### `basic_auth_password` -[![Build Status](https://travis-ci.org/puppetlabs/puppetlabs-vcsrepo.png?branch=master)](https://travis-ci.org/puppetlabs/puppetlabs-vcsrepo) +Specifies the password for HTTP Basic authentication. (Requires the `basic_auth` feature.) Valid options: a string. Default: none. -####Table of Contents +##### `basic_auth_username` -1. [Overview](#overview) -2. [Module Description - What the module does and why it is useful](#module-description) -3. [Setup - The basics of getting started with vcsrepo](#setup) - * [Beginning with vcsrepo](#beginning-with-vcsrepo) -4. [Usage - Configuration options and additional functionality](#usage) - * [Bazaar](#bazaar) - * [CVS](#cvs) - * [Git](#git) - * [Mercurial](#mercurial) - * [Perforce](#perforce) - * [Subversion](#subversion) -5. [Reference - An under-the-hood peek at what the module is doing and how](#reference) - * [Type: vcsrepo](#type-vcsrepo) - * [Providers](#providers) - * [Features](#features) - * [Parameters](#parameters) - * [Features and Parameters by Provider](#features-and-parameters-by-provider) -5. [Limitations - OS compatibility, etc.](#limitations) -6. [Development - Guide for contributing to the module](#development) +Specifies the username for HTTP Basic authentication. (Requires the `basic_auth` feature.) Valid options: a string. Default: none. -##Overview +##### `compression` -The vcsrepo module allows you to use Puppet to easily deploy content from your version control system (VCS). +Sets the GZIP compression level for the repository history. (Requires the `gzip_compression` feature.) Valid options: an integer between 0 and 6. Default: none. -##Module Description +##### `configuration` -This module provides a single type with providers for each VCS, which can be used to describe: +Sets the configuration directory to use. (Requires the `configuration` feature.) Valid options: a string containing an absolute path. Default: none. -* A working copy checked out from a (remote or local) source, at an - arbitrary revision -* A blank working copy not associated with a source (when it makes - sense for the VCS being used) -* A blank central repository (when the distinction makes sense for the VCS - being used) +##### `conflict` -##Setup +Tells Subversion how to resolve any conflicts between the source repository and your working copy. (Requires the `conflict` feature.) Valid options: 'base', 'mine-full', 'theirs-full', and 'working'. Default: none. -Before you begin using vcsrepo, it's worth keeping in mind that this module will not install VCS software for you. If you are going to use this module, you must have already installed your preferred VCS. +##### `cvs_rsh` -Also, this module, like Puppet generally, will not create parent directories for you. You will need to have your parent directories in place before you begin. +Provides a value for the `CVS_RSH` environment variable. (Requires the `cvs_rsh` feature.) Valid options: a string. Default: none. -###Beginning with vcsrepo +##### `depth` -To get started with the vcsrepo module, you must simply define the type `vcsrepo` with a path to your repository and the [type of VCS](#Usage) you're using in `provider` (in the below example, Git). +Sets the number of commits to include when creating a shallow clone. (Requires the `depth` feature.) Valid options: an integer. Default: none. - vcsrepo { "/path/to/repo": - ensure => present, - provider => git, - } +##### `ensure` -##Usage +Specifies whether the repository should exist. Valid options: 'present', 'bare', 'absent', and 'latest'. Default: 'present'. -The vcsrepo module works with the following VCSs: +##### `excludes` -* [Git (git)](#git)* -* [Bazaar (bzr)](#bazaar) -* [CVS (cvs)](#cvs) -* [Mercurial (hg)](#mercurial) -* [Perforce (p4)](#perforce) -* [Subversion (svn)](#subversion) +Lists any files the repository shouldn't track (similar to .gitignore). Valid options: a string (separate multiple values with the newline character). Default: none. -**Note:** Git is the only VCS provider officially [supported](https://forge.puppetlabs.com/supported) by Puppet Labs. +##### `force` +Specifies whether to delete any existing files in the repository path if creating a new repository. **Use with care.** Valid options: 'true' and 'false'. Default: 'false'. -###Git +##### `fstype` -#####To create a blank repository +Sets the filesystem type. (Requires the `filesystem_types` feature.) Valid options: 'fsfs' or 'bdb'. Default: none. -To create a blank repository suitable for use as a central repository, -define `vcsrepo` without `source` or `revision`. +##### `group` - vcsrepo { "/path/to/repo": - ensure => present, - provider => git, - } +Specifies a group to own the repository files. Valid options: a string containing a group name or GID. Default: none. -If you're defining `vcsrepo` for a central or official repository, you may want to make it a bare repository. You do this by setting `ensure` to 'bare' rather than 'present'. +##### `identity` - vcsrepo { "/path/to/repo": - ensure => bare, - provider => git, - } +Specifies an identity file to use for SSH authentication. (Requires the `ssh_identity` feature.) Valid options: a string containing an absolute path. Default: none. -#####To clone/pull a repository +##### `module` -To get the current HEAD on the master branch, +Specifies the repository module to manage. (Requires the `modules` feature.) Valid options: a string containing the name of a CVS module. Default: none. - vcsrepo { "/path/to/repo": - ensure => present, - provider => git, - source => "git://example.com/repo.git", - } +##### `owner` -To get a specific revision or branch (can be a commit SHA, tag, or branch name), +Specifies a user to own the repository files. Valid options: a string containing a username or UID. Default: none. - **SHA** +##### `p4config` - vcsrepo { "/path/to/repo": - ensure => present, - provider => git, - source => 'git://example.com/repo.git', - revision => '0c466b8a5a45f6cd7de82c08df2fb4ce1e920a31', - } +Specifies a config file that contains settings for connecting to the Perforce service. (Requires the `p4config` feature.) Valid options: a string containing the absolute path to a valid [Perforce config file](http://www.perforce.com/perforce/doc.current/manuals/p4guide/chapter.configuration.html#configuration.settings.configfiles). Default: none. -**Tag** +##### `path` - vcsrepo { "/path/to/repo": - ensure => present, - provider => git, - source => 'git://example.com/repo.git', - revision => '1.1.2rc1', - } +Specifies a location for the managed repository. Valid options: a string containing an absolute path. Default: the title of your declared resource. -**Branch name** +##### `provider` - vcsrepo { "/path/to/repo": - ensure => present, - provider => git, - source => 'git://example.com/repo.git', - revision => 'development', - } +*Required.* Specifies the backend to use for this vcsrepo resource. Valid options: 'bzr', 'cvs', 'git', 'hg', 'p4', and 'svn'. -To check out a branch as a specific user, +##### `remote` - vcsrepo { "/path/to/repo": - ensure => present, - provider => git, - source => 'git://example.com/repo.git', - revision => '0c466b8a5a45f6cd7de82c08df2fb4ce1e920a31', - user => 'someUser', - } +Specifies the remote repository to track. (Requires the `multiple_remotes` feature.) Valid options: a string containing one of the remote names specified in `source`. Default: 'origin'. -To keep the repository at the latest revision (**WARNING:** this will always overwrite local changes to the repository), +##### `revision` - vcsrepo { "/path/to/repo": - ensure => latest, - provider => git, - source => 'git://example.com/repo.git', - revision => 'master', - } +Sets the revision of the repository. Valid options vary by provider: -To clone the repository but skip initialiazing submodules, +* `git` - a string containing a Git branch name, or a commit SHA or tag +* `bzr` - a string containing a Bazaar [revisionspec](http://wiki.bazaar.canonical.com/BzrRevisionSpec) +* `cvs` - a string containing a CVS [tag or revision number](http://www.thathost.com/wincvs-howto/cvsdoc/cvs_4.html) +* `hg` - a string containing a Mercurial [changeset ID](http://mercurial.selenic.com/wiki/ChangeSetID) or [tag](http://mercurial.selenic.com/wiki/Tag) +* `p4` - a string containing a Perforce [change number, label name, client name, or date spec](http://www.perforce.com/perforce/r12.1/manuals/cmdref/o.fspecs.html) +* `svn` - a string containing a Subversion [revision number](http://svnbook.red-bean.com/en/1.7/svn.basic.in-action.html#svn.basic.in-action.revs), [revision keyword, or revision date](http://svnbook.red-bean.com/en/1.7/svn.tour.revs.specifiers.html) - vcsrepo { "/path/to/repo": - ensure => latest, - provider => git, - source => 'git://example.com/repo.git', - submodules => false, - } +Default: none. -##### Using multiple remotes with a repository -Instead of specifying a single string in the 'source' property, you can specify a hash with multiple name => URL mappings, +##### `source` - vcsrepo { "/path/to/repo": - ensure => present, - provider => git, - source => { - "origin" => "https://github.com/puppetlabs/puppetlabs-vcsrepo.git", - "other_remote" => "https://github.com/other_user/puppetlabs-vcsrepo.git" - }, - } +Specifies a source repository to serve as the upstream for your managed repository. Default: none. Valid options vary by provider: -It is important to note that you must specify a mapping for the remote that is specified in the 'remote' property - this is set to 'origin' by default. +* `git` - a string containing a [Git repository URL](https://www.kernel.org/pub/software/scm/git/docs/git-clone.html#_git_urls_a_id_urls_a) or a hash of name => URL mappings. See also [`remote`](#remote). +* `bzr` - a string containing a Bazaar branch location +* `cvs` - a string containing a CVS root +* `hg` - a string containing the local path or URL of a Mercurial repository +* `p4` - a string containing a Perforce depot path +* `svn` - a string containing a Subversion repository URL -#####Sources that use SSH +Default: none. -When your source uses SSH, such as 'username@server:…', you can manage your SSH keys with Puppet using the [require](http://docs.puppetlabs.com/references/stable/metaparameter.html#require) metaparameter in `vcsrepo` to ensure they are present. +##### `submodules` -For SSH keys associated with a user, enter the username in the `user` parameter. Doing so will use that user's keys. +Specifies whether to initialize and update each submodule in the repository. (Requires the `submodules` feature.) Valid options: 'true' and 'false'. Default: 'true'. - user => 'toto' # will use toto's $HOME/.ssh setup +##### `user` -#####Further Examples - -For more examples using Git, see `examples/git/`. - -###Bazaar - -#####Create a blank repository - -To create a blank repository suitable for use as a central repository, -define `vcsrepo` without `source` or `revision`. - - vcsrepo { "/path/to/repo": - ensure => present, - provider => bzr, - } - -#####Branch from an existing repository - -Provide the `source` location to branch from an existing repository. - - vcsrepo { "/path/to/repo": - ensure => present, - provider => bzr, - source => 'lp:myproj', - } - -For a specific revision, use `revision` with a valid revisionspec -(see `bzr help revisionspec` for more information on formatting a revision). - - vcsrepo { "/path/to/repo": - ensure => present, - provider => bzr, - source => 'lp:myproj', - revision => 'menesis@pov.lt-20100309191856-4wmfqzc803fj300x', - } - -#####Sources that use SSH - -When your source uses SSH, for instance 'bzr+ssh://...' or 'sftp://...,' -you can manage your SSH keys with Puppet using the [require](http://docs.puppetlabs.com/references/stable/metaparameter.html#require) metaparameter in `vcsrepo` to ensure they are present. - -#####Further examples - -For more examples using Bazaar, see `examples/bzr/`. - -###CVS - -#####To create a blank repository - -To create a blank repository suitable for use as a central repository, -define `vcsrepo` without `source` or `revision`. - - vcsrepo { "/path/to/repo": - ensure => present, - provider => cvs, - } - -#####To checkout/update from a repository - -To get the current mainline, - - vcsrepo { "/path/to/workspace": - ensure => present, - provider => cvs, - source => ":pserver:anonymous@example.com:/sources/myproj", - } - -To get a specific module on the current mainline, - - vcsrepo {"/vagrant/lockss-daemon-source": - ensure => present, - provider => cvs, - source => ":pserver:anonymous@lockss.cvs.sourceforge.net:/cvsroot/lockss", - module => "lockss-daemon", - } - - -You can use the `compression` parameter to set the GZIP compression levels for your repository history. - - vcsrepo { "/path/to/workspace": - ensure => present, - provider => cvs, - compression => 3, - source => ":pserver:anonymous@example.com:/sources/myproj", - } - -For a specific tag, use `revision`. - - vcsrepo { "/path/to/workspace": - ensure => present, - provider => cvs, - compression => 3, - source => ":pserver:anonymous@example.com:/sources/myproj", - revision => "SOMETAG", - } - -#####Sources that use SSH - -When your source uses SSH, you can manage your SSH keys with Puppet using the [require](http://docs.puppetlabs.com/references/stable/metaparameter.html#require) metaparameter in `vcsrepo` to ensure they are present. - -#####Further examples - -For for more examples using CVS, see `examples/cvs/`. - -###Mercurial - -#####To create a blank repository - -To create a blank repository suitable for use as a central repository, -define `vcsrepo` without `source` or `revision`. - - vcsrepo { "/path/to/repo": - ensure => present, - provider => hg, - } - -#####To clone/pull & update a repository - -To get the default branch tip, - - vcsrepo { "/path/to/repo": - ensure => present, - provider => hg, - source => "http://hg.example.com/myrepo", - } - -For a specific changeset, use `revision`. - - vcsrepo { "/path/to/repo": - ensure => present, - provider => hg, - source => "http://hg.example.com/myrepo", - revision => '21ea4598c962', - } - -You can also set `revision` to a tag. - - vcsrepo { "/path/to/repo": - ensure => present, - provider => hg, - source => "http://hg.example.com/myrepo", - revision => '1.1.2', - } - -To check out as a specific user, - - vcsrepo { "/path/to/repo": - ensure => present, - provider => hg, - source => "http://hg.example.com/myrepo", - user => 'user', - } - -To specify an SSH identity key, - - vcsrepo { "/path/to/repo": - ensure => present, - provider => hg, - source => "ssh://hg@hg.example.com/myrepo", - identity => "/home/user/.ssh/id_dsa, - } - -To specify a username and password for HTTP Basic authentication, - - vcsrepo { "/path/to/repo": - ensure => latest, - provider => hg, - source => 'http://hg.example.com/myrepo', - basic_auth_username => 'hgusername', - basic_auth_password => 'hgpassword', - } - -#####Sources that use SSH - -When your source uses SSH, such as 'ssh://...', you can manage your SSH keys with Puppet using the [require](http://docs.puppetlabs.com/references/stable/metaparameter.html#require) metaparameter in `vcsrepo` to ensure they are present. - -#####Further Examples - -For more examples using Mercurial, see `examples/hg/`. - -###Perforce - -#####To create an empty Workspace - -To create an empty Workspace, define a `vcsrepo` without a `source` or `revision`. The -Environment variables P4PORT, P4USER, etc... are used to define the Perforce server -connection settings. - - vcsrepo { "/path/to/repo": - ensure => present, - provider => p4 - } - -If no `P4CLIENT` environment name is provided a workspace generated name is calculated -based on the Digest of path and hostname. For example: - - puppet-91bc00640c4e5a17787286acbe2c021c - -A Perforce configuration file can be used by setting the `P4CONFIG` environment or -defining `p4config`. If a configuration is defined, then the environment variable for -`P4CLIENT` is replaced. - - vcsrepo { "/path/to/repo": - ensure => present, - provider => p4, - p4config => '.p4config' - } - -#####To create/update and sync a Perforce workspace - -To sync a depot path to head, ensure `latest`: - - vcsrepo { "/path/to/repo": - ensure => latest, - provider => p4, - source => '//depot/branch/...' - } - -For a specific changelist, ensure `present` and specify a `revision`: - - vcsrepo { "/path/to/repo": - ensure => present, - provider => p4, - source => '//depot/branch/...', - revision => '2341' - } - -You can also set `revision` to a label: - - vcsrepo { "/path/to/repo": - ensure => present, - provider => p4, - source => '//depot/branch/...', - revision => 'my_label' - } - -#####To authenticate against the Perforce server - -Either set the environment variables `P4USER` and `P4PASSWD` or use a configuration file. -For secure servers set the `P4PASSWD` with a valid ticket generated using `p4 login -p`. - -#####Further Examples - -For examples you can run, see `examples/p4/` - -###Subversion - -#####To create a blank repository - -To create a blank repository suitable for use as a central repository, -define `vcsrepo` without `source` or `revision`. - - vcsrepo { "/path/to/repo": - ensure => present, - provider => svn, - } - -#####To check out from a repository - -Provide a `source` pointing to the branch/tag you want to check out from a repository. - - vcsrepo { "/path/to/repo": - ensure => present, - provider => svn, - source => "svn://svnrepo/hello/branches/foo", - } - -You can also provide a specific revision. - - vcsrepo { "/path/to/repo": - ensure => present, - provider => svn, - source => "svn://svnrepo/hello/branches/foo", - revision => '1234', - } - -#####Using a specific Subversion configuration directory - -To use a specific configuration directory, provide a `configuration` parameter which should be a directory path on the local system where your svn configuration files are. Typically, it is '/path/to/.subversion'. - - vcsrepo { "/path/to/repo": - ensure => present, - provider => svn, - source => "svn://svnrepo/hello/branches/foo", - configuration => "/path/to/.subversion", - } - -#####Sources that use SSH - -When your source uses SSH, such as 'svn+ssh://...', you can manage your SSH keys with Puppet using the [require](http://docs.puppetlabs.com/references/stable/metaparameter.html#require) metaparameter in `vcsrepo` to ensure they are present. - -####Further examples - -For more examples using Subversion, see `examples/svn/`. - -##Reference - -###Type: vcsrepo - -The vcsrepo module is slightly unusual in that it is simply a type and providers. Each provider abstracts a different VCS, and a series of features are available to each provider based on its specific needs. - -####Providers - -**Note**: Not all features are available with all providers. - -* `git` - Supports the Git VCS. (Contains features: `bare_repositories`, `depth`, `multiple_remotes`, `reference_tracking`, `ssh_identity`, `user`.) -* `bar` - Supports the Bazaar VCS. (Contains features: `reference_tracking`.) -* `cvs` - Supports the CVS VCS. (Contains features: `cvs_rsh`, `gzip_compression`, `modules`, `reference_tracking`, `user`.) -* `dummy` - -* `hg` - Supports the Mercurial VCS. (Contains features: `reference_tracking`, `ssh_identity`, `user`.) -* `p4` - Supports the Perforce VCS. (Contains features: `reference_tracking`, `filesystem_types`, `p4config`.) -* `svn` - Supports the Subversion VCS. (Contains features: `basic_auth`, `configuration`, `filesystem_types`, `reference_tracking`.) - -####Features - -**Note**: Not all features are available with all providers. - -* `bare_repositories` - The provider differentiates between bare repositories and those with working copies. (Available with `git`.) -* `basic_auth` - The provider supports HTTP Basic Authentication. (Available with `svn`.) -* `configuration` - The provider supports setting the configuration path.(Available with `svn`.) -* `cvs_rsh` - The provider understands the CVS_RSH environment variable. (Available with `cvs`.) -* `depth` - The provider can do shallow clones. (Available with `git`.) -* `filesystem_types` - The provider supports different filesystem types. (Available with `svn`.) -* `gzip_compression` - The provider supports explicit GZip compression levels. (Available with `cvs`.) -* `modules` - The provider allows specific repository modules to be chosen. (Available with `cvs`.) -* `multiple_remotes` - The repository tracks multiple remote repositories. (Available with `git`.) -* `reference_tracking` - The provider supports tracking revision references that can change over time (e.g. some VCS tags and branch names). (Available with `bar`, `cvs`, `git`, `hg`, `svn`.) -* `ssh_identity` - The provider supports a configurable SSH identity file. (Available with `git` and `hg`.) -* `user` - The provider can run as a different user. (Available with `git`, `hg` and `cvs`.) -* `p4config` - The provider support setting the P4CONFIG environment. (Available with `p4`.) -* `submodules` - The provider supports repository submodules which can be optionally initialized. (Available with `git`.) - -####Parameters - -* `basic_auth_password` - Specifies the HTTP Basic Authentication password. (Requires the `basic_auth` feature.) -* `basic_auth_username` - Specifies the HTTP Basic Authentication username. (Requires the `basic_auth` feature.) -* `compression` - Set the GZIP compression levels for your repository history. (Requires the `gzip_compression` feature.) -* `configuration` - Sets the configuration directory to use. (Requires the `configuration` feature.) -* `cvs_rsh` - The value to be used for the CVS_RSH environment variable. (Requires the `cvs_rsh` feature.) -* `depth` - The value to be used to do a shallow clone. (Requires the `depth` feature.) -* `ensure` - Determines the state of the repository. Valid values are 'present', 'bare', 'absent', 'latest'. -* `excludes` - Lists any files to be excluded from being tracked by the repository (similiar to .gitignore). Can be an array or string. -* `force` - Forces repository creation. Valid values are 'true' and 'false'. **WARNING** Forcing will destroy any files in the path. -* `fstype` - Sets the filesystem type. (Requires the `filesystem_types` feature.) -* `group` - Determines the group/gid that owns the repository files. -* `identity` - Specifies the SSH identity file. (Requires the `ssh_identity` feature.) -* `module` - Specifies the repository module to manage. (Requires the `modules` feature.) -* `owner` - Specifies the user/uid that owns the repository files. -* `path` - Specifies the absolute path to the repository. If omitted, the value defaults to the resource's title. -* `provider` - Specifies the backend to use for this vcsrepo resource. -* `remote` - Specifies the remote repository to track. (Requires the `multiple_remotes` feature.) -* `revision` - Sets the revision of the repository. Values can match /^\S+$/. -* `source` - Specifies the source URI for the repository. -* `user` - Specifies the user to run as for repository operations. -* `p4config` - Specifies the P4CONFIG environment used for Perforce connection configuration. - -####Features and Parameters by Provider - -#####`git` -**Features**: `bare_repositories`, `depth`, `multiple_remotes`, `reference_tracking`, `ssh_identity`, `user`, `submodules` - -**Parameters**: `depth`, `ensure`, `excludes`, `force`, `group`, `identity`, `owner`, `path`, `provider`, `remote`, `revision`, `source`, `user`, `submodules` - -#####`bzr` -**Features**: `reference_tracking` - -**Parameters**: `ensure`, `excludes`, `force`, `group`, `owner`, `path`, `provider`, `revision`, `source`, `user` - -#####`cvs` -**Features**: `cvs_rsh`, `gzip_compression`, `modules`, `reference_tracking`, `revision` - -**Parameters**: `compression`, `cvs_rsh`, `ensure`, `excludes`, `force`, `group`, `module`, `owner`, `path`, `provider`, `revision`, `source`, `user` - -#####`hg` -**Features**: `reference_tracking`, `ssh_identity`, `user` - -**Parameters**: `ensure`, `excludes`, `force`, `group`, `identity`, `owner`, `path`, `provider`, `revision`, `source`, `user` - -#####`p4` -**Features**: `reference_tracking`, `filesystem_types`, `p4config` - -**Parameters**: `ensure`, `group`, `owner`, `path`, `provider`, `revision`, `source`, `p4config` - -#####`svn` -**Features**: `basic_auth`, `configuration`, `filesystem_types`, `reference_tracking` - -**Parameters**: `basic_auth_password`, `basic_auth_username`, `configuration`, `ensure`, `excludes`, `force`, `fstype`, `group`, `owner`, `path`, `provider`, `revision`, `source`, `user` - -##Limitations - -Git is the only VCS provider officially [supported](https://forge.puppetlabs.com/supported) by Puppet Labs. - -This module has been built on and tested against Puppet 2.7 and higher. - -The module has been tested on: - -RedHat Enterprise Linux 5/6 -Debian 6/7 -CentOS 5/6 -Ubuntu 12.04 -Gentoo -Arch Linux -FreeBSD - -Testing on other platforms has been light and cannot be guaranteed. - -##Development - -Puppet Labs modules on the Puppet Forge are open projects, and community contributions are essential for keeping them great. We can’t access the huge number of platforms and myriad of hardware, software, and deployment configurations that Puppet is intended to serve. - -We want to keep it as easy as possible to contribute changes so that our modules work in your environment. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things. - -You can read the complete module contribution guide on the Puppet Labs wiki. +Specifies the user to run as for repository operations. (Requires the `user` feature.) Valid options: a string containing a username or UID. Default: none. + +##Limitations + +Git is the only VCS provider officially [supported](https://forge.puppetlabs.com/supported) by Puppet Labs. + +This module has been tested with Puppet 2.7 and higher. + +The module has been tested on: + +* Red Hat Enterprise Linux 5/6 +* Debian 6/7 +* CentOS 5/6 +* Ubuntu 12.04 + +Testing on other platforms has been light and cannot be guaranteed. + +##Development + +Puppet Labs modules on the Puppet Forge are open projects, and community contributions are essential for keeping them great. We can't access the huge number of platforms and myriad of hardware, software, and deployment configurations that Puppet is intended to serve. + +We want to keep it as easy as possible to contribute changes so that our modules work in your environment. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things. + +You can read the complete module contribution guide [on the Puppet Labs wiki.](http://projects.puppetlabs.com/projects/module-site/wiki/Module_contributing) \ No newline at end of file -- cgit v1.2.3 From f900efd909155c7a9c1d6d74f63d9e919436ccec Mon Sep 17 00:00:00 2001 From: Pete Soloway Date: Mon, 18 May 2015 13:18:36 -0700 Subject: Last-minute README corrections MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Corrected the list of supported platforms under Limitations * Spelled “revision spec” instead of “revisionspec”. --- README.markdown | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'README.markdown') diff --git a/README.markdown b/README.markdown index 34988bc..badb1ce 100644 --- a/README.markdown +++ b/README.markdown @@ -221,7 +221,7 @@ vcsrepo { '/path/to/repo': } ~~~ -To branch from a specific revision, set `revision` to a valid [Bazaar revisionspec](http://wiki.bazaar.canonical.com/BzrRevisionSpec): +To branch from a specific revision, set `revision` to a valid [Bazaar revision spec](http://wiki.bazaar.canonical.com/BzrRevisionSpec): ~~~ vcsrepo { '/path/to/repo': @@ -686,7 +686,7 @@ Specifies the remote repository to track. (Requires the `multiple_remotes` featu Sets the revision of the repository. Valid options vary by provider: * `git` - a string containing a Git branch name, or a commit SHA or tag -* `bzr` - a string containing a Bazaar [revisionspec](http://wiki.bazaar.canonical.com/BzrRevisionSpec) +* `bzr` - a string containing a Bazaar [revision spec](http://wiki.bazaar.canonical.com/BzrRevisionSpec) * `cvs` - a string containing a CVS [tag or revision number](http://www.thathost.com/wincvs-howto/cvsdoc/cvs_4.html) * `hg` - a string containing a Mercurial [changeset ID](http://mercurial.selenic.com/wiki/ChangeSetID) or [tag](http://mercurial.selenic.com/wiki/Tag) * `p4` - a string containing a Perforce [change number, label name, client name, or date spec](http://www.perforce.com/perforce/r12.1/manuals/cmdref/o.fspecs.html) @@ -723,10 +723,13 @@ This module has been tested with Puppet 2.7 and higher. The module has been tested on: -* Red Hat Enterprise Linux 5/6 -* Debian 6/7 -* CentOS 5/6 -* Ubuntu 12.04 +* CentOS 5/6/7 +* Debian 6/7 +* Oracle 5/6/7 +* Red Hat Enterprise Linux 5/6/7 +* Scientific Linux 5/6/7 +* SLES 10/11/12 +* Ubuntu 10.04/12.04/14.04 Testing on other platforms has been light and cannot be guaranteed. -- cgit v1.2.3 From 7758331f503a9198921362761079cbfd941c625e Mon Sep 17 00:00:00 2001 From: monai Date: Wed, 9 Sep 2015 19:20:58 +0300 Subject: Add feature depth and param trust_server_cert to svn added param trust server cert updated depth feature updated README.markdown trust_server_cert is not feature trust_server_cert default value should be false add test for depth and trust_server_cert --- README.markdown | 300 +++++++++++++++++++++++++++++--------------------------- 1 file changed, 153 insertions(+), 147 deletions(-) (limited to 'README.markdown') diff --git a/README.markdown b/README.markdown index badb1ce..4c65bbc 100644 --- a/README.markdown +++ b/README.markdown @@ -180,7 +180,7 @@ vcsrepo { '/path/to/repo': } ~~~ -**Note:** if you set `source` to a hash, one of the names you specify must match the value of the `remote` parameter. That remote serves as the upstream of your managed repository. +**Note:** if you set `source` to a hash, one of the names you specify must match the value of the `remote` parameter. That remote serves as the upstream of your managed repository. ####Connect via SSH @@ -196,7 +196,7 @@ vcsrepo { '/path/to/repo': user => 'toto', #uses toto's $HOME/.ssh setup require => File['/home/toto/.ssh/id_rsa'], } -~~~ +~~~ ###Bazaar @@ -235,7 +235,7 @@ vcsrepo { '/path/to/repo': ####Connect via SSH To connect to your source repository via SSH (e.g., `'bzr+ssh://...'` or `'sftp://...,'`), we recommend using the [`require`](http://docs.puppetlabs.com/references/stable/metaparameter.html#require) metaparameter to make sure your SSH keys are present before the `vcsrepo` resource is applied: - + ~~~ vcsrepo { '/path/to/repo': ensure => latest, @@ -244,7 +244,7 @@ vcsrepo { '/path/to/repo': user => 'toto', #uses toto's $HOME/.ssh setup require => File['/home/toto/.ssh/id_rsa'], } -~~~ +~~~ ###CVS @@ -301,10 +301,10 @@ vcsrepo { '/path/to/workspace': source => ':pserver:anonymous@example.com:/sources/myproj', revision => '1.2', } -~~~ - +~~~ + You can also set `revision` to a tag: - + ~~~ vcsrepo { '/path/to/workspace': ensure => present, @@ -313,12 +313,12 @@ vcsrepo { '/path/to/workspace': source => ':pserver:anonymous@example.com:/sources/myproj', revision => 'SOMETAG', } -~~~ +~~~ ####Connect via SSH To connect to your source repository via SSH, we recommend using the [`require`](http://docs.puppetlabs.com/references/stable/metaparameter.html#require) metaparameter to make sure your SSH keys are present before the `vcsrepo` resource is applied: - + ~~~ vcsrepo { '/path/to/repo': ensure => latest, @@ -413,7 +413,7 @@ vcsrepo { '/path/to/repo': ####Connect via SSH To connect to your source repository via SSH (e.g., `'ssh://...'`), we recommend using the [`require` metaparameter](http://docs.puppetlabs.com/references/stable/metaparameter.html#require) to make sure your SSH keys are present before the `vcsrepo` resource is applied: - + ~~~ vcsrepo { '/path/to/repo': ensure => latest, @@ -425,11 +425,11 @@ vcsrepo { '/path/to/repo': ~~~ ###Perforce - -####Create an empty workspace - -To set up the connection to your Perforce service, set `p4config` to the location of a valid Perforce [config file](http://www.perforce.com/perforce/doc.current/manuals/p4guide/chapter.configuration.html#configuration.settings.configfiles) stored on the node: - + +####Create an empty workspace + +To set up the connection to your Perforce service, set `p4config` to the location of a valid Perforce [config file](http://www.perforce.com/perforce/doc.current/manuals/p4guide/chapter.configuration.html#configuration.settings.configfiles) stored on the node: + ~~~ vcsrepo { '/path/to/repo': ensure => present, @@ -437,9 +437,9 @@ vcsrepo { '/path/to/repo': p4config => '/root/.p4config' } ~~~ - -**Note:** If you don't include the `P4CLIENT` setting in your config file, the provider generates a workspace name based on the digest of `path` and the node's hostname (e.g., `puppet-91bc00640c4e5a17787286acbe2c021c`): - + +**Note:** If you don't include the `P4CLIENT` setting in your config file, the provider generates a workspace name based on the digest of `path` and the node's hostname (e.g., `puppet-91bc00640c4e5a17787286acbe2c021c`): + ####Create/update and sync a Perforce workspace To sync a depot path to head, set `ensure` to 'latest': @@ -524,7 +524,7 @@ vcsrepo { '/path/to/repo': ####Connect via SSH To connect to your source repository via SSH (e.g., `'svn+ssh://...'`), we recommend using the [`require` metaparameter](http://docs.puppetlabs.com/references/stable/metaparameter.html#require) to make sure your SSH keys are present before the `vcsrepo` resource is applied: - + ~~~ vcsrepo { '/path/to/repo': ensure => latest, @@ -547,7 +547,7 @@ The vcsrepo module adds only one type with several providers. Each provider abst #####`git` - Supports the Git VCS. -Features: `bare_repositories`, `depth`, `multiple_remotes`, `reference_tracking`, `ssh_identity`, `submodules`, `user` +Features: `bare_repositories`, `depth`, `multiple_remotes`, `reference_tracking`, `ssh_identity`, `submodules`, `user` Parameters: `depth`, `ensure`, `excludes`, `force`, `group`, `identity`, `owner`, `path`, `provider`, `remote`, `revision`, `source`, `user` @@ -555,42 +555,42 @@ Parameters: `depth`, `ensure`, `excludes`, `force`, `group`, `identity`, `owner` Features: `reference_tracking` -Parameters: `ensure`, `excludes`, `force`, `group`, `owner`, `path`, `provider`, `revision`, `source` +Parameters: `ensure`, `excludes`, `force`, `group`, `owner`, `path`, `provider`, `revision`, `source` #####`cvs` - Supports the CVS VCS. Features: `cvs_rsh`, `gzip_compression`, `modules`, `reference_tracking`, `user` - -Parameters: `compression`, `cvs_rsh`, `ensure`, `excludes`, `force`, `group`, `module`, `owner`, `path`, `provider` + +Parameters: `compression`, `cvs_rsh`, `ensure`, `excludes`, `force`, `group`, `module`, `owner`, `path`, `provider` #####`hg` - Supports the Mercurial VCS. -Features: `reference_tracking`, `ssh_identity`, `user` +Features: `reference_tracking`, `ssh_identity`, `user` -Parameters: `ensure`, `excludes`, `force`, `group`, `identity`, `owner`, `path`, `provider`, `revision`, `source`, `user` +Parameters: `ensure`, `excludes`, `force`, `group`, `identity`, `owner`, `path`, `provider`, `revision`, `source`, `user` #####`p4` - Supports the Perforce VCS. -Features: `p4config`, `reference_tracking` +Features: `p4config`, `reference_tracking` -Parameters: `ensure`, `excludes`, `force`, `group`, `owner`, `p4config`, `path`, `provider`, `revision`, `source` +Parameters: `ensure`, `excludes`, `force`, `group`, `owner`, `p4config`, `path`, `provider`, `revision`, `source` #####`svn` - Supports the Subversion VCS. -Features: `basic_auth`, `configuration`, `conflict`, `filesystem_types`, `reference_tracking` - -Parameters: `basic_auth_password`, `basic_auth_username`, `configuration`, `conflict`, `ensure`, `excludes`, `force`, `fstype`, `group`, `owner`, `path`, `provider`, `revision`, `source` +Features: `basic_auth`, `configuration`, `conflict`, `depth`, `filesystem_types`, `reference_tracking` + +Parameters: `basic_auth_password`, `basic_auth_username`, `configuration`, `conflict`, `ensure`, `excludes`, `force`, `fstype`, `group`, `owner`, `path`, `provider`, `revision`, `source`, `trust_server_cert` ####Features **Note:** Not all features are available with all providers. * `bare_repositories` - Differentiates between bare repositories and those with working copies. (Available with `git`.) -* `basic_auth` - Supports HTTP Basic authentication. (Available with `svn`.) +* `basic_auth` - Supports HTTP Basic authentication. (Available with `svn`.) * `conflict` - Lets you decide how to resolve any conflicts between the source repository and your working copy. (Available with `svn`.) * `configuration` - Lets you specify the location of your configuration files. (Available with `svn`.) * `cvs_rsh` - Understands the `CVS_RSH` environment variable. (Available with `cvs`.) -* `depth` - Supports shallow clones. (Available with `git`.) +* `depth` - Supports shallow clones in `git` or sets scope limit in `svn`. (Available with `git` and `svn`.) * `filesystem_types` - Supports multiple types of filesystem. (Available with `svn`.) * `gzip_compression` - Supports explicit GZip compression levels. (Available with `cvs`.) * `modules` - Lets you choose a specific repository module. (Available with `cvs`.) @@ -603,116 +603,122 @@ Parameters: `basic_auth_password`, `basic_auth_username`, `configuration`, `conf ####Parameters -All parameters are optional, except where specified otherwise. - -##### `basic_auth_password` - -Specifies the password for HTTP Basic authentication. (Requires the `basic_auth` feature.) Valid options: a string. Default: none. - -##### `basic_auth_username` - -Specifies the username for HTTP Basic authentication. (Requires the `basic_auth` feature.) Valid options: a string. Default: none. - -##### `compression` - -Sets the GZIP compression level for the repository history. (Requires the `gzip_compression` feature.) Valid options: an integer between 0 and 6. Default: none. - -##### `configuration` - -Sets the configuration directory to use. (Requires the `configuration` feature.) Valid options: a string containing an absolute path. Default: none. - -##### `conflict` - -Tells Subversion how to resolve any conflicts between the source repository and your working copy. (Requires the `conflict` feature.) Valid options: 'base', 'mine-full', 'theirs-full', and 'working'. Default: none. - -##### `cvs_rsh` - -Provides a value for the `CVS_RSH` environment variable. (Requires the `cvs_rsh` feature.) Valid options: a string. Default: none. - -##### `depth` - -Sets the number of commits to include when creating a shallow clone. (Requires the `depth` feature.) Valid options: an integer. Default: none. - -##### `ensure` - -Specifies whether the repository should exist. Valid options: 'present', 'bare', 'absent', and 'latest'. Default: 'present'. - -##### `excludes` - -Lists any files the repository shouldn't track (similar to .gitignore). Valid options: a string (separate multiple values with the newline character). Default: none. - -##### `force` - -Specifies whether to delete any existing files in the repository path if creating a new repository. **Use with care.** Valid options: 'true' and 'false'. Default: 'false'. - -##### `fstype` - -Sets the filesystem type. (Requires the `filesystem_types` feature.) Valid options: 'fsfs' or 'bdb'. Default: none. - -##### `group` - -Specifies a group to own the repository files. Valid options: a string containing a group name or GID. Default: none. - -##### `identity` - -Specifies an identity file to use for SSH authentication. (Requires the `ssh_identity` feature.) Valid options: a string containing an absolute path. Default: none. - -##### `module` - -Specifies the repository module to manage. (Requires the `modules` feature.) Valid options: a string containing the name of a CVS module. Default: none. - -##### `owner` - -Specifies a user to own the repository files. Valid options: a string containing a username or UID. Default: none. - -##### `p4config` - -Specifies a config file that contains settings for connecting to the Perforce service. (Requires the `p4config` feature.) Valid options: a string containing the absolute path to a valid [Perforce config file](http://www.perforce.com/perforce/doc.current/manuals/p4guide/chapter.configuration.html#configuration.settings.configfiles). Default: none. - -##### `path` - -Specifies a location for the managed repository. Valid options: a string containing an absolute path. Default: the title of your declared resource. - -##### `provider` - -*Required.* Specifies the backend to use for this vcsrepo resource. Valid options: 'bzr', 'cvs', 'git', 'hg', 'p4', and 'svn'. - -##### `remote` - -Specifies the remote repository to track. (Requires the `multiple_remotes` feature.) Valid options: a string containing one of the remote names specified in `source`. Default: 'origin'. - -##### `revision` - -Sets the revision of the repository. Valid options vary by provider: - -* `git` - a string containing a Git branch name, or a commit SHA or tag -* `bzr` - a string containing a Bazaar [revision spec](http://wiki.bazaar.canonical.com/BzrRevisionSpec) -* `cvs` - a string containing a CVS [tag or revision number](http://www.thathost.com/wincvs-howto/cvsdoc/cvs_4.html) -* `hg` - a string containing a Mercurial [changeset ID](http://mercurial.selenic.com/wiki/ChangeSetID) or [tag](http://mercurial.selenic.com/wiki/Tag) -* `p4` - a string containing a Perforce [change number, label name, client name, or date spec](http://www.perforce.com/perforce/r12.1/manuals/cmdref/o.fspecs.html) -* `svn` - a string containing a Subversion [revision number](http://svnbook.red-bean.com/en/1.7/svn.basic.in-action.html#svn.basic.in-action.revs), [revision keyword, or revision date](http://svnbook.red-bean.com/en/1.7/svn.tour.revs.specifiers.html) - -Default: none. - -##### `source` - -Specifies a source repository to serve as the upstream for your managed repository. Default: none. Valid options vary by provider: - -* `git` - a string containing a [Git repository URL](https://www.kernel.org/pub/software/scm/git/docs/git-clone.html#_git_urls_a_id_urls_a) or a hash of name => URL mappings. See also [`remote`](#remote). -* `bzr` - a string containing a Bazaar branch location -* `cvs` - a string containing a CVS root -* `hg` - a string containing the local path or URL of a Mercurial repository -* `p4` - a string containing a Perforce depot path -* `svn` - a string containing a Subversion repository URL - -Default: none. - -##### `submodules` - -Specifies whether to initialize and update each submodule in the repository. (Requires the `submodules` feature.) Valid options: 'true' and 'false'. Default: 'true'. - -##### `user` - +All parameters are optional, except where specified otherwise. + +##### `basic_auth_password` + +Specifies the password for HTTP Basic authentication. (Requires the `basic_auth` feature.) Valid options: a string. Default: none. + +##### `basic_auth_username` + +Specifies the username for HTTP Basic authentication. (Requires the `basic_auth` feature.) Valid options: a string. Default: none. + +##### `compression` + +Sets the GZIP compression level for the repository history. (Requires the `gzip_compression` feature.) Valid options: an integer between 0 and 6. Default: none. + +##### `configuration` + +Sets the configuration directory to use. (Requires the `configuration` feature.) Valid options: a string containing an absolute path. Default: none. + +##### `conflict` + +Tells Subversion how to resolve any conflicts between the source repository and your working copy. (Requires the `conflict` feature.) Valid options: 'base', 'mine-full', 'theirs-full', and 'working'. Default: none. + +##### `cvs_rsh` + +Provides a value for the `CVS_RSH` environment variable. (Requires the `cvs_rsh` feature.) Valid options: a string. Default: none. + +##### `depth` + +In `git` sets the number of commits to include when creating a shallow clone. (Requires the `depth` feature.) Valid options: an integer. Default: none. + +In `svn` instructs Subversion to limit the scope of an operation to a particular tree depth. (Requires the `depth` feature.) Valid options: 'empty', 'files', 'immediates', 'infinity'. Default: none. + +##### `ensure` + +Specifies whether the repository should exist. Valid options: 'present', 'bare', 'absent', and 'latest'. Default: 'present'. + +##### `excludes` + +Lists any files the repository shouldn't track (similar to .gitignore). Valid options: a string (separate multiple values with the newline character). Default: none. + +##### `force` + +Specifies whether to delete any existing files in the repository path if creating a new repository. **Use with care.** Valid options: 'true' and 'false'. Default: 'false'. + +##### `fstype` + +Sets the filesystem type. (Requires the `filesystem_types` feature.) Valid options: 'fsfs' or 'bdb'. Default: none. + +##### `group` + +Specifies a group to own the repository files. Valid options: a string containing a group name or GID. Default: none. + +##### `identity` + +Specifies an identity file to use for SSH authentication. (Requires the `ssh_identity` feature.) Valid options: a string containing an absolute path. Default: none. + +##### `module` + +Specifies the repository module to manage. (Requires the `modules` feature.) Valid options: a string containing the name of a CVS module. Default: none. + +##### `owner` + +Specifies a user to own the repository files. Valid options: a string containing a username or UID. Default: none. + +##### `p4config` + +Specifies a config file that contains settings for connecting to the Perforce service. (Requires the `p4config` feature.) Valid options: a string containing the absolute path to a valid [Perforce config file](http://www.perforce.com/perforce/doc.current/manuals/p4guide/chapter.configuration.html#configuration.settings.configfiles). Default: none. + +##### `path` + +Specifies a location for the managed repository. Valid options: a string containing an absolute path. Default: the title of your declared resource. + +##### `provider` + +*Required.* Specifies the backend to use for this vcsrepo resource. Valid options: 'bzr', 'cvs', 'git', 'hg', 'p4', and 'svn'. + +##### `remote` + +Specifies the remote repository to track. (Requires the `multiple_remotes` feature.) Valid options: a string containing one of the remote names specified in `source`. Default: 'origin'. + +##### `revision` + +Sets the revision of the repository. Valid options vary by provider: + +* `git` - a string containing a Git branch name, or a commit SHA or tag +* `bzr` - a string containing a Bazaar [revision spec](http://wiki.bazaar.canonical.com/BzrRevisionSpec) +* `cvs` - a string containing a CVS [tag or revision number](http://www.thathost.com/wincvs-howto/cvsdoc/cvs_4.html) +* `hg` - a string containing a Mercurial [changeset ID](http://mercurial.selenic.com/wiki/ChangeSetID) or [tag](http://mercurial.selenic.com/wiki/Tag) +* `p4` - a string containing a Perforce [change number, label name, client name, or date spec](http://www.perforce.com/perforce/r12.1/manuals/cmdref/o.fspecs.html) +* `svn` - a string containing a Subversion [revision number](http://svnbook.red-bean.com/en/1.7/svn.basic.in-action.html#svn.basic.in-action.revs), [revision keyword, or revision date](http://svnbook.red-bean.com/en/1.7/svn.tour.revs.specifiers.html) + +Default: none. + +##### `source` + +Specifies a source repository to serve as the upstream for your managed repository. Default: none. Valid options vary by provider: + +* `git` - a string containing a [Git repository URL](https://www.kernel.org/pub/software/scm/git/docs/git-clone.html#_git_urls_a_id_urls_a) or a hash of name => URL mappings. See also [`remote`](#remote). +* `bzr` - a string containing a Bazaar branch location +* `cvs` - a string containing a CVS root +* `hg` - a string containing the local path or URL of a Mercurial repository +* `p4` - a string containing a Perforce depot path +* `svn` - a string containing a Subversion repository URL + +Default: none. + +##### `submodules` + +Specifies whether to initialize and update each submodule in the repository. (Requires the `submodules` feature.) Valid options: 'true' and 'false'. Default: 'true'. + +##### `trust_server_cert` + +Instructs Subversion to accept SSL server certificates issued by unknown certificate authorities. Valid options: 'true' and 'false'. Default: 'false'. + +##### `user` + Specifies the user to run as for repository operations. (Requires the `user` feature.) Valid options: a string containing a username or UID. Default: none. ##Limitations @@ -723,12 +729,12 @@ This module has been tested with Puppet 2.7 and higher. The module has been tested on: -* CentOS 5/6/7 -* Debian 6/7 +* CentOS 5/6/7 +* Debian 6/7 * Oracle 5/6/7 * Red Hat Enterprise Linux 5/6/7 -* Scientific Linux 5/6/7 -* SLES 10/11/12 +* Scientific Linux 5/6/7 +* SLES 10/11/12 * Ubuntu 10.04/12.04/14.04 Testing on other platforms has been light and cannot be guaranteed. @@ -739,4 +745,4 @@ Puppet Labs modules on the Puppet Forge are open projects, and community contrib We want to keep it as easy as possible to contribute changes so that our modules work in your environment. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things. -You can read the complete module contribution guide [on the Puppet Labs wiki.](http://projects.puppetlabs.com/projects/module-site/wiki/Module_contributing) +You can read the complete module contribution guide [on the Puppet Labs wiki.](http://projects.puppetlabs.com/projects/module-site/wiki/Module_contributing) -- cgit v1.2.3 From 9a9f343e8358c05766a2899c0e9037fd98df4595 Mon Sep 17 00:00:00 2001 From: tphoney Date: Thu, 17 Sep 2015 18:54:21 +0100 Subject: dos2unix the readme --- README.markdown | 1496 +++++++++++++++++++++++++++---------------------------- 1 file changed, 748 insertions(+), 748 deletions(-) (limited to 'README.markdown') diff --git a/README.markdown b/README.markdown index 4c65bbc..e878891 100644 --- a/README.markdown +++ b/README.markdown @@ -1,748 +1,748 @@ -#vcsrepo - -####Table of Contents - -1. [Overview](#overview) -2. [Module Description - What the module does and why it is useful](#module-description) -3. [Setup - The basics of getting started with vcsrepo](#setup) - * [Setup requirements](#setup-requirements) - * [Beginning with vcsrepo](#beginning-with-vcsrepo) -4. [Usage - Configuration options and additional functionality](#usage) - * [Git](#git) - * [Bazaar](#bazaar) - * [CVS](#cvs) - * [Mercurial](#mercurial) - * [Perforce](#perforce) - * [Subversion](#subversion) -5. [Reference - An under-the-hood peek at what the module is doing and how](#reference) - * [Type: vcsrepo](#type-vcsrepo) - * [Providers](#providers) - * [Features](#features) - * [Parameters](#parameters) -5. [Limitations - OS compatibility, etc.](#limitations) -6. [Development - Guide for contributing to the module](#development) - -##Overview - -The vcsrepo module lets you use Puppet to easily deploy content from your version control system (VCS). - -##Module Description - -The vcsrepo module provides a single type with providers to support the following version control systems: - -* [Git](#git) -* [Bazaar](#bazaar) -* [CVS](#cvs) -* [Mercurial](#mercurial) -* [Perforce](#perforce) -* [Subversion](#subversion) - -**Note:** `git` is the only vcs provider officially [supported by Puppet Labs](https://forge.puppetlabs.com/supported). - -##Setup - -###Setup Requirements - -The `vcsrepo` module does not install any VCS software for you. You must install a VCS before you can use this module. - -Like Puppet in general, the `vcsrepo` module does not automatically create parent directories for the files it manages. Make sure to set up any needed directory structures before you get started. - -###Beginning with vcsrepo - -To create and manage a blank repository, define the type `vcsrepo` with a path to your repository and supply the `provider` parameter based on the [VCS you're using](#usage). - -~~~ -vcsrepo { '/path/to/repo': - ensure => present, - provider => git, -} -~~~ - -##Usage - -**Note:** `git` is the only vcsrepo provider officially [supported by Puppet Labs](https://forge.puppetlabs.com/supported). - -###Git - -####Create a blank repository - -To create a blank repository, suitable for use as a central repository, define `vcsrepo` without `source` or `revision`: - -~~~ -vcsrepo { '/path/to/repo': - ensure => present, - provider => git, -} -~~~ - -If you're managing a central or official repository, you might want to make it a bare repository. To do this, set `ensure` to 'bare': - -~~~ -vcsrepo { '/path/to/repo': - ensure => bare, - provider => git, -} -~~~ - -####Clone/pull a repository - -~~~ -vcsrepo { '/path/to/repo': - ensure => present, - provider => git, - source => 'git://example.com/repo.git', -} -~~~ - -By default, `vcsrepo` will use the HEAD of the source repository's master branch. To use another branch or a specific commit, set `revision` to either a branch name or a commit SHA or tag. - -Branch name: - -~~~ -vcsrepo { '/path/to/repo': - ensure => present, - provider => git, - source => 'git://example.com/repo.git', - revision => 'development', -} -~~~ - -SHA: - -~~~ -vcsrepo { '/path/to/repo': - ensure => present, - provider => git, - source => 'git://example.com/repo.git', - revision => '0c466b8a5a45f6cd7de82c08df2fb4ce1e920a31', -} -~~~ - -Tag: - -~~~ -vcsrepo { '/path/to/repo': - ensure => present, - provider => git, - source => 'git://example.com/repo.git', - revision => '1.1.2rc1', -} -~~~ - -To check out a branch as a specific user, supply the `user` parameter: - -~~~ -vcsrepo { '/path/to/repo': - ensure => present, - provider => git, - source => 'git://example.com/repo.git', - revision => '0c466b8a5a45f6cd7de82c08df2fb4ce1e920a31', - user => 'someUser', -} -~~~ - -To keep the repository at the latest revision, set `ensure` to 'latest'. - -**WARNING:** this overwrites any local changes to the repository: - -~~~ -vcsrepo { '/path/to/repo': - ensure => latest, - provider => git, - source => 'git://example.com/repo.git', - revision => 'master', -} -~~~ - -To clone the repository but skip initializing submodules, set `submodules` to 'false': - -~~~ -vcsrepo { '/path/to/repo': - ensure => latest, - provider => git, - source => 'git://example.com/repo.git', - submodules => false, -} -~~~ - -####Use multiple remotes with a repository -In place of a single string, you can set `source` to a hash of one or more name => URL pairs: - -~~~ -vcsrepo { '/path/to/repo': - ensure => present, - provider => git, - remote => 'origin' - source => { - 'origin' => 'https://github.com/puppetlabs/puppetlabs-vcsrepo.git', - 'other_remote' => 'https://github.com/other_user/puppetlabs-vcsrepo.git' - }, -} -~~~ - -**Note:** if you set `source` to a hash, one of the names you specify must match the value of the `remote` parameter. That remote serves as the upstream of your managed repository. - -####Connect via SSH - -To connect to your source repository via SSH (e.g., 'username@server:…'), we recommend managing your SSH keys with Puppet and using the [`require`](http://docs.puppetlabs.com/references/stable/metaparameter.html#require) metaparameter to make sure they are present before the `vcsrepo` resource is applied. - -To use SSH keys associated with a user, specify the username in the `user` parameter: - -~~~ -vcsrepo { '/path/to/repo': - ensure => latest, - provider => git, - source => 'git://username@example.com/repo.git', - user => 'toto', #uses toto's $HOME/.ssh setup - require => File['/home/toto/.ssh/id_rsa'], -} -~~~ - -###Bazaar - -####Create a blank repository - -To create a blank repository, suitable for use as a central repository, define `vcsrepo` without `source` or `revision`: - -~~~ -vcsrepo { '/path/to/repo': - ensure => present, - provider => bzr, -} -~~~ - -####Branch from an existing repository - -~~~ -vcsrepo { '/path/to/repo': - ensure => present, - provider => bzr, - source => '/some/path', -} -~~~ - -To branch from a specific revision, set `revision` to a valid [Bazaar revision spec](http://wiki.bazaar.canonical.com/BzrRevisionSpec): - -~~~ -vcsrepo { '/path/to/repo': - ensure => present, - provider => bzr, - source => '/some/path', - revision => 'menesis@pov.lt-20100309191856-4wmfqzc803fj300x', -} -~~~ - -####Connect via SSH - -To connect to your source repository via SSH (e.g., `'bzr+ssh://...'` or `'sftp://...,'`), we recommend using the [`require`](http://docs.puppetlabs.com/references/stable/metaparameter.html#require) metaparameter to make sure your SSH keys are present before the `vcsrepo` resource is applied: - -~~~ -vcsrepo { '/path/to/repo': - ensure => latest, - provider => bzr, - source => 'bzr+ssh://bzr.example.com/some/path', - user => 'toto', #uses toto's $HOME/.ssh setup - require => File['/home/toto/.ssh/id_rsa'], -} -~~~ - -###CVS - -####Create a blank repository - -To create a blank repository, suitable for use as a central repository, define `vcsrepo` without `source` or `revision`: - -~~~ -vcsrepo { '/path/to/repo': - ensure => present, - provider => cvs, -} -~~~ - -####Checkout/update from a repository - -~~~ -vcsrepo { '/path/to/workspace': - ensure => present, - provider => cvs, - source => ':pserver:anonymous@example.com:/sources/myproj', -} -~~~ - -To get a specific module on the current mainline, supply the `module` parameter: - -~~~ -vcsrepo {'/vagrant/lockss-daemon-source': - ensure => present, - provider => cvs, - source => ':pserver:anonymous@lockss.cvs.sourceforge.net:/cvsroot/lockss', - module => 'lockss-daemon', -} -~~~ - -To set the GZIP compression levels for your repository history, use the `compression` parameter: - -~~~ -vcsrepo { '/path/to/workspace': - ensure => present, - provider => cvs, - compression => 3, - source => ':pserver:anonymous@example.com:/sources/myproj', -} -~~~ - -To get a specific revision, set `revision` to the revision number. - -~~~ -vcsrepo { '/path/to/workspace': - ensure => present, - provider => cvs, - compression => 3, - source => ':pserver:anonymous@example.com:/sources/myproj', - revision => '1.2', -} -~~~ - -You can also set `revision` to a tag: - -~~~ -vcsrepo { '/path/to/workspace': - ensure => present, - provider => cvs, - compression => 3, - source => ':pserver:anonymous@example.com:/sources/myproj', - revision => 'SOMETAG', -} -~~~ - -####Connect via SSH - -To connect to your source repository via SSH, we recommend using the [`require`](http://docs.puppetlabs.com/references/stable/metaparameter.html#require) metaparameter to make sure your SSH keys are present before the `vcsrepo` resource is applied: - -~~~ -vcsrepo { '/path/to/repo': - ensure => latest, - provider => cvs, - source => ':pserver:anonymous@example.com:/sources/myproj', - user => 'toto', #uses toto's $HOME/.ssh setup - require => File['/home/toto/.ssh/id_rsa'], -} -~~~ - -###Mercurial - -####Create a blank repository - -To create a blank repository, suitable for use as a central repository, define `vcsrepo` without `source` or `revision`: - -~~~ -vcsrepo { '/path/to/repo': - ensure => present, - provider => hg, -} -~~~ - -####Clone/pull & update a repository - -To get the default branch tip: - -~~~ -vcsrepo { '/path/to/repo': - ensure => present, - provider => hg, - source => 'http://hg.example.com/myrepo', -} -~~~ - -For a specific changeset, use `revision`: - -~~~ -vcsrepo { '/path/to/repo': - ensure => present, - provider => hg, - source => 'http://hg.example.com/myrepo', - revision => '21ea4598c962', -} -~~~ - -You can also set `revision` to a tag: - -~~~ -vcsrepo { '/path/to/repo': - ensure => present, - provider => hg, - source => 'http://hg.example.com/myrepo', - revision => '1.1.2', -} -~~~ - -To check out as a specific user: - -~~~ -vcsrepo { '/path/to/repo': - ensure => present, - provider => hg, - source => 'http://hg.example.com/myrepo', - user => 'user', -} -~~~ - -To specify an SSH identity key: - -~~~ -vcsrepo { '/path/to/repo': - ensure => present, - provider => hg, - source => 'ssh://hg@hg.example.com/myrepo', - identity => '/home/user/.ssh/id_dsa1, -} -~~~ - -To specify a username and password for HTTP Basic authentication: - -~~~ -vcsrepo { '/path/to/repo': - ensure => latest, - provider => hg, - source => 'http://hg.example.com/myrepo', - basic_auth_username => 'hgusername', - basic_auth_password => 'hgpassword', -} -~~~ - -####Connect via SSH - -To connect to your source repository via SSH (e.g., `'ssh://...'`), we recommend using the [`require` metaparameter](http://docs.puppetlabs.com/references/stable/metaparameter.html#require) to make sure your SSH keys are present before the `vcsrepo` resource is applied: - -~~~ -vcsrepo { '/path/to/repo': - ensure => latest, - provider => hg, - source => 'ssh://hg.example.com//path/to/myrepo', - user => 'toto', #uses toto's $HOME/.ssh setup - require => File['/home/toto/.ssh/id_rsa'], -} -~~~ - -###Perforce - -####Create an empty workspace - -To set up the connection to your Perforce service, set `p4config` to the location of a valid Perforce [config file](http://www.perforce.com/perforce/doc.current/manuals/p4guide/chapter.configuration.html#configuration.settings.configfiles) stored on the node: - -~~~ -vcsrepo { '/path/to/repo': - ensure => present, - provider => p4, - p4config => '/root/.p4config' -} -~~~ - -**Note:** If you don't include the `P4CLIENT` setting in your config file, the provider generates a workspace name based on the digest of `path` and the node's hostname (e.g., `puppet-91bc00640c4e5a17787286acbe2c021c`): - -####Create/update and sync a Perforce workspace - -To sync a depot path to head, set `ensure` to 'latest': - -~~~ -vcsrepo { '/path/to/repo': - ensure => latest, - provider => p4, - source => '//depot/branch/...' -} -~~~ - -To sync to a specific changelist, specify its revision number with the `revision` parameter: - -~~~ -vcsrepo { '/path/to/repo': - ensure => present, - provider => p4, - source => '//depot/branch/...', - revision => '2341' -} -~~~ - -You can also set `revision` to a label: - -~~~ -vcsrepo { '/path/to/repo': - ensure => present, - provider => p4, - source => '//depot/branch/...', - revision => 'my_label' -} -~~~ - -###Subversion - -####Create a blank repository - -~~~ -vcsrepo { '/path/to/repo': - ensure => present, - provider => svn, -} -~~~ - -####Check out from an existing repository - -Provide a `source` pointing to the branch or tag you want to check out: - -~~~ -vcsrepo { '/path/to/repo': - ensure => present, - provider => svn, - source => 'svn://svnrepo/hello/branches/foo', -} -~~~ - -You can also designate a specific revision: - -~~~ -vcsrepo { '/path/to/repo': - ensure => present, - provider => svn, - source => 'svn://svnrepo/hello/branches/foo', - revision => '1234', -} -~~~ - -####Use a specific Subversion configuration directory - -Use the `configuration` parameter to designate the directory that contains your Subversion configuration files (typically, '/path/to/.subversion'): - -~~~ -vcsrepo { '/path/to/repo': - ensure => present, - provider => svn, - source => 'svn://svnrepo/hello/branches/foo', - configuration => '/path/to/.subversion', -} -~~~ - -####Connect via SSH - -To connect to your source repository via SSH (e.g., `'svn+ssh://...'`), we recommend using the [`require` metaparameter](http://docs.puppetlabs.com/references/stable/metaparameter.html#require) to make sure your SSH keys are present before the `vcsrepo` resource is applied: - -~~~ -vcsrepo { '/path/to/repo': - ensure => latest, - provider => svn, - source => 'svn+ssh://svnrepo/hello/branches/foo', - user => 'toto', #uses toto's $HOME/.ssh setup - require => File['/home/toto/.ssh/id_rsa'], -} -~~~ - -##Reference - -###Type: vcsrepo - -The vcsrepo module adds only one type with several providers. Each provider abstracts a different VCS, and each provider includes a set of features according to its needs. - -####Providers - -**Note:** Not all features are available with all providers. - -#####`git` - Supports the Git VCS. - -Features: `bare_repositories`, `depth`, `multiple_remotes`, `reference_tracking`, `ssh_identity`, `submodules`, `user` - -Parameters: `depth`, `ensure`, `excludes`, `force`, `group`, `identity`, `owner`, `path`, `provider`, `remote`, `revision`, `source`, `user` - -#####`bzr` - Supports the Bazaar VCS. - -Features: `reference_tracking` - -Parameters: `ensure`, `excludes`, `force`, `group`, `owner`, `path`, `provider`, `revision`, `source` - -#####`cvs` - Supports the CVS VCS. - -Features: `cvs_rsh`, `gzip_compression`, `modules`, `reference_tracking`, `user` - -Parameters: `compression`, `cvs_rsh`, `ensure`, `excludes`, `force`, `group`, `module`, `owner`, `path`, `provider` - -#####`hg` - Supports the Mercurial VCS. - -Features: `reference_tracking`, `ssh_identity`, `user` - -Parameters: `ensure`, `excludes`, `force`, `group`, `identity`, `owner`, `path`, `provider`, `revision`, `source`, `user` - -#####`p4` - Supports the Perforce VCS. - -Features: `p4config`, `reference_tracking` - -Parameters: `ensure`, `excludes`, `force`, `group`, `owner`, `p4config`, `path`, `provider`, `revision`, `source` - -#####`svn` - Supports the Subversion VCS. - -Features: `basic_auth`, `configuration`, `conflict`, `depth`, `filesystem_types`, `reference_tracking` - -Parameters: `basic_auth_password`, `basic_auth_username`, `configuration`, `conflict`, `ensure`, `excludes`, `force`, `fstype`, `group`, `owner`, `path`, `provider`, `revision`, `source`, `trust_server_cert` - -####Features - -**Note:** Not all features are available with all providers. - -* `bare_repositories` - Differentiates between bare repositories and those with working copies. (Available with `git`.) -* `basic_auth` - Supports HTTP Basic authentication. (Available with `svn`.) -* `conflict` - Lets you decide how to resolve any conflicts between the source repository and your working copy. (Available with `svn`.) -* `configuration` - Lets you specify the location of your configuration files. (Available with `svn`.) -* `cvs_rsh` - Understands the `CVS_RSH` environment variable. (Available with `cvs`.) -* `depth` - Supports shallow clones in `git` or sets scope limit in `svn`. (Available with `git` and `svn`.) -* `filesystem_types` - Supports multiple types of filesystem. (Available with `svn`.) -* `gzip_compression` - Supports explicit GZip compression levels. (Available with `cvs`.) -* `modules` - Lets you choose a specific repository module. (Available with `cvs`.) -* `multiple_remotes` - Tracks multiple remote repositories. (Available with `git`.) -* `reference_tracking` - Lets you track revision references that can change over time (e.g., some VCS tags and branch names). (Available with all providers) -* `ssh_identity` - Lets you specify an SSH identity file. (Available with `git` and `hg`.) -* `user` - Can run as a different user. (Available with `git`, `hg` and `cvs`.) -* `p4config` - Supports setting the `P4CONFIG` environment. (Available with `p4`.) -* `submodules` - Supports repository submodules which can be optionally initialized. (Available with `git`.) - -####Parameters - -All parameters are optional, except where specified otherwise. - -##### `basic_auth_password` - -Specifies the password for HTTP Basic authentication. (Requires the `basic_auth` feature.) Valid options: a string. Default: none. - -##### `basic_auth_username` - -Specifies the username for HTTP Basic authentication. (Requires the `basic_auth` feature.) Valid options: a string. Default: none. - -##### `compression` - -Sets the GZIP compression level for the repository history. (Requires the `gzip_compression` feature.) Valid options: an integer between 0 and 6. Default: none. - -##### `configuration` - -Sets the configuration directory to use. (Requires the `configuration` feature.) Valid options: a string containing an absolute path. Default: none. - -##### `conflict` - -Tells Subversion how to resolve any conflicts between the source repository and your working copy. (Requires the `conflict` feature.) Valid options: 'base', 'mine-full', 'theirs-full', and 'working'. Default: none. - -##### `cvs_rsh` - -Provides a value for the `CVS_RSH` environment variable. (Requires the `cvs_rsh` feature.) Valid options: a string. Default: none. - -##### `depth` - -In `git` sets the number of commits to include when creating a shallow clone. (Requires the `depth` feature.) Valid options: an integer. Default: none. - -In `svn` instructs Subversion to limit the scope of an operation to a particular tree depth. (Requires the `depth` feature.) Valid options: 'empty', 'files', 'immediates', 'infinity'. Default: none. - -##### `ensure` - -Specifies whether the repository should exist. Valid options: 'present', 'bare', 'absent', and 'latest'. Default: 'present'. - -##### `excludes` - -Lists any files the repository shouldn't track (similar to .gitignore). Valid options: a string (separate multiple values with the newline character). Default: none. - -##### `force` - -Specifies whether to delete any existing files in the repository path if creating a new repository. **Use with care.** Valid options: 'true' and 'false'. Default: 'false'. - -##### `fstype` - -Sets the filesystem type. (Requires the `filesystem_types` feature.) Valid options: 'fsfs' or 'bdb'. Default: none. - -##### `group` - -Specifies a group to own the repository files. Valid options: a string containing a group name or GID. Default: none. - -##### `identity` - -Specifies an identity file to use for SSH authentication. (Requires the `ssh_identity` feature.) Valid options: a string containing an absolute path. Default: none. - -##### `module` - -Specifies the repository module to manage. (Requires the `modules` feature.) Valid options: a string containing the name of a CVS module. Default: none. - -##### `owner` - -Specifies a user to own the repository files. Valid options: a string containing a username or UID. Default: none. - -##### `p4config` - -Specifies a config file that contains settings for connecting to the Perforce service. (Requires the `p4config` feature.) Valid options: a string containing the absolute path to a valid [Perforce config file](http://www.perforce.com/perforce/doc.current/manuals/p4guide/chapter.configuration.html#configuration.settings.configfiles). Default: none. - -##### `path` - -Specifies a location for the managed repository. Valid options: a string containing an absolute path. Default: the title of your declared resource. - -##### `provider` - -*Required.* Specifies the backend to use for this vcsrepo resource. Valid options: 'bzr', 'cvs', 'git', 'hg', 'p4', and 'svn'. - -##### `remote` - -Specifies the remote repository to track. (Requires the `multiple_remotes` feature.) Valid options: a string containing one of the remote names specified in `source`. Default: 'origin'. - -##### `revision` - -Sets the revision of the repository. Valid options vary by provider: - -* `git` - a string containing a Git branch name, or a commit SHA or tag -* `bzr` - a string containing a Bazaar [revision spec](http://wiki.bazaar.canonical.com/BzrRevisionSpec) -* `cvs` - a string containing a CVS [tag or revision number](http://www.thathost.com/wincvs-howto/cvsdoc/cvs_4.html) -* `hg` - a string containing a Mercurial [changeset ID](http://mercurial.selenic.com/wiki/ChangeSetID) or [tag](http://mercurial.selenic.com/wiki/Tag) -* `p4` - a string containing a Perforce [change number, label name, client name, or date spec](http://www.perforce.com/perforce/r12.1/manuals/cmdref/o.fspecs.html) -* `svn` - a string containing a Subversion [revision number](http://svnbook.red-bean.com/en/1.7/svn.basic.in-action.html#svn.basic.in-action.revs), [revision keyword, or revision date](http://svnbook.red-bean.com/en/1.7/svn.tour.revs.specifiers.html) - -Default: none. - -##### `source` - -Specifies a source repository to serve as the upstream for your managed repository. Default: none. Valid options vary by provider: - -* `git` - a string containing a [Git repository URL](https://www.kernel.org/pub/software/scm/git/docs/git-clone.html#_git_urls_a_id_urls_a) or a hash of name => URL mappings. See also [`remote`](#remote). -* `bzr` - a string containing a Bazaar branch location -* `cvs` - a string containing a CVS root -* `hg` - a string containing the local path or URL of a Mercurial repository -* `p4` - a string containing a Perforce depot path -* `svn` - a string containing a Subversion repository URL - -Default: none. - -##### `submodules` - -Specifies whether to initialize and update each submodule in the repository. (Requires the `submodules` feature.) Valid options: 'true' and 'false'. Default: 'true'. - -##### `trust_server_cert` - -Instructs Subversion to accept SSL server certificates issued by unknown certificate authorities. Valid options: 'true' and 'false'. Default: 'false'. - -##### `user` - -Specifies the user to run as for repository operations. (Requires the `user` feature.) Valid options: a string containing a username or UID. Default: none. - -##Limitations - -Git is the only VCS provider officially [supported](https://forge.puppetlabs.com/supported) by Puppet Labs. - -This module has been tested with Puppet 2.7 and higher. - -The module has been tested on: - -* CentOS 5/6/7 -* Debian 6/7 -* Oracle 5/6/7 -* Red Hat Enterprise Linux 5/6/7 -* Scientific Linux 5/6/7 -* SLES 10/11/12 -* Ubuntu 10.04/12.04/14.04 - -Testing on other platforms has been light and cannot be guaranteed. - -##Development - -Puppet Labs modules on the Puppet Forge are open projects, and community contributions are essential for keeping them great. We can't access the huge number of platforms and myriad of hardware, software, and deployment configurations that Puppet is intended to serve. - -We want to keep it as easy as possible to contribute changes so that our modules work in your environment. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things. - -You can read the complete module contribution guide [on the Puppet Labs wiki.](http://projects.puppetlabs.com/projects/module-site/wiki/Module_contributing) +#vcsrepo + +####Table of Contents + +1. [Overview](#overview) +2. [Module Description - What the module does and why it is useful](#module-description) +3. [Setup - The basics of getting started with vcsrepo](#setup) + * [Setup requirements](#setup-requirements) + * [Beginning with vcsrepo](#beginning-with-vcsrepo) +4. [Usage - Configuration options and additional functionality](#usage) + * [Git](#git) + * [Bazaar](#bazaar) + * [CVS](#cvs) + * [Mercurial](#mercurial) + * [Perforce](#perforce) + * [Subversion](#subversion) +5. [Reference - An under-the-hood peek at what the module is doing and how](#reference) + * [Type: vcsrepo](#type-vcsrepo) + * [Providers](#providers) + * [Features](#features) + * [Parameters](#parameters) +5. [Limitations - OS compatibility, etc.](#limitations) +6. [Development - Guide for contributing to the module](#development) + +##Overview + +The vcsrepo module lets you use Puppet to easily deploy content from your version control system (VCS). + +##Module Description + +The vcsrepo module provides a single type with providers to support the following version control systems: + +* [Git](#git) +* [Bazaar](#bazaar) +* [CVS](#cvs) +* [Mercurial](#mercurial) +* [Perforce](#perforce) +* [Subversion](#subversion) + +**Note:** `git` is the only vcs provider officially [supported by Puppet Labs](https://forge.puppetlabs.com/supported). + +##Setup + +###Setup Requirements + +The `vcsrepo` module does not install any VCS software for you. You must install a VCS before you can use this module. + +Like Puppet in general, the `vcsrepo` module does not automatically create parent directories for the files it manages. Make sure to set up any needed directory structures before you get started. + +###Beginning with vcsrepo + +To create and manage a blank repository, define the type `vcsrepo` with a path to your repository and supply the `provider` parameter based on the [VCS you're using](#usage). + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => git, +} +~~~ + +##Usage + +**Note:** `git` is the only vcsrepo provider officially [supported by Puppet Labs](https://forge.puppetlabs.com/supported). + +###Git + +####Create a blank repository + +To create a blank repository, suitable for use as a central repository, define `vcsrepo` without `source` or `revision`: + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => git, +} +~~~ + +If you're managing a central or official repository, you might want to make it a bare repository. To do this, set `ensure` to 'bare': + +~~~ +vcsrepo { '/path/to/repo': + ensure => bare, + provider => git, +} +~~~ + +####Clone/pull a repository + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => git, + source => 'git://example.com/repo.git', +} +~~~ + +By default, `vcsrepo` will use the HEAD of the source repository's master branch. To use another branch or a specific commit, set `revision` to either a branch name or a commit SHA or tag. + +Branch name: + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => git, + source => 'git://example.com/repo.git', + revision => 'development', +} +~~~ + +SHA: + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => git, + source => 'git://example.com/repo.git', + revision => '0c466b8a5a45f6cd7de82c08df2fb4ce1e920a31', +} +~~~ + +Tag: + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => git, + source => 'git://example.com/repo.git', + revision => '1.1.2rc1', +} +~~~ + +To check out a branch as a specific user, supply the `user` parameter: + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => git, + source => 'git://example.com/repo.git', + revision => '0c466b8a5a45f6cd7de82c08df2fb4ce1e920a31', + user => 'someUser', +} +~~~ + +To keep the repository at the latest revision, set `ensure` to 'latest'. + +**WARNING:** this overwrites any local changes to the repository: + +~~~ +vcsrepo { '/path/to/repo': + ensure => latest, + provider => git, + source => 'git://example.com/repo.git', + revision => 'master', +} +~~~ + +To clone the repository but skip initializing submodules, set `submodules` to 'false': + +~~~ +vcsrepo { '/path/to/repo': + ensure => latest, + provider => git, + source => 'git://example.com/repo.git', + submodules => false, +} +~~~ + +####Use multiple remotes with a repository +In place of a single string, you can set `source` to a hash of one or more name => URL pairs: + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => git, + remote => 'origin' + source => { + 'origin' => 'https://github.com/puppetlabs/puppetlabs-vcsrepo.git', + 'other_remote' => 'https://github.com/other_user/puppetlabs-vcsrepo.git' + }, +} +~~~ + +**Note:** if you set `source` to a hash, one of the names you specify must match the value of the `remote` parameter. That remote serves as the upstream of your managed repository. + +####Connect via SSH + +To connect to your source repository via SSH (e.g., 'username@server:…'), we recommend managing your SSH keys with Puppet and using the [`require`](http://docs.puppetlabs.com/references/stable/metaparameter.html#require) metaparameter to make sure they are present before the `vcsrepo` resource is applied. + +To use SSH keys associated with a user, specify the username in the `user` parameter: + +~~~ +vcsrepo { '/path/to/repo': + ensure => latest, + provider => git, + source => 'git://username@example.com/repo.git', + user => 'toto', #uses toto's $HOME/.ssh setup + require => File['/home/toto/.ssh/id_rsa'], +} +~~~ + +###Bazaar + +####Create a blank repository + +To create a blank repository, suitable for use as a central repository, define `vcsrepo` without `source` or `revision`: + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => bzr, +} +~~~ + +####Branch from an existing repository + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => bzr, + source => '/some/path', +} +~~~ + +To branch from a specific revision, set `revision` to a valid [Bazaar revision spec](http://wiki.bazaar.canonical.com/BzrRevisionSpec): + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => bzr, + source => '/some/path', + revision => 'menesis@pov.lt-20100309191856-4wmfqzc803fj300x', +} +~~~ + +####Connect via SSH + +To connect to your source repository via SSH (e.g., `'bzr+ssh://...'` or `'sftp://...,'`), we recommend using the [`require`](http://docs.puppetlabs.com/references/stable/metaparameter.html#require) metaparameter to make sure your SSH keys are present before the `vcsrepo` resource is applied: + +~~~ +vcsrepo { '/path/to/repo': + ensure => latest, + provider => bzr, + source => 'bzr+ssh://bzr.example.com/some/path', + user => 'toto', #uses toto's $HOME/.ssh setup + require => File['/home/toto/.ssh/id_rsa'], +} +~~~ + +###CVS + +####Create a blank repository + +To create a blank repository, suitable for use as a central repository, define `vcsrepo` without `source` or `revision`: + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => cvs, +} +~~~ + +####Checkout/update from a repository + +~~~ +vcsrepo { '/path/to/workspace': + ensure => present, + provider => cvs, + source => ':pserver:anonymous@example.com:/sources/myproj', +} +~~~ + +To get a specific module on the current mainline, supply the `module` parameter: + +~~~ +vcsrepo {'/vagrant/lockss-daemon-source': + ensure => present, + provider => cvs, + source => ':pserver:anonymous@lockss.cvs.sourceforge.net:/cvsroot/lockss', + module => 'lockss-daemon', +} +~~~ + +To set the GZIP compression levels for your repository history, use the `compression` parameter: + +~~~ +vcsrepo { '/path/to/workspace': + ensure => present, + provider => cvs, + compression => 3, + source => ':pserver:anonymous@example.com:/sources/myproj', +} +~~~ + +To get a specific revision, set `revision` to the revision number. + +~~~ +vcsrepo { '/path/to/workspace': + ensure => present, + provider => cvs, + compression => 3, + source => ':pserver:anonymous@example.com:/sources/myproj', + revision => '1.2', +} +~~~ + +You can also set `revision` to a tag: + +~~~ +vcsrepo { '/path/to/workspace': + ensure => present, + provider => cvs, + compression => 3, + source => ':pserver:anonymous@example.com:/sources/myproj', + revision => 'SOMETAG', +} +~~~ + +####Connect via SSH + +To connect to your source repository via SSH, we recommend using the [`require`](http://docs.puppetlabs.com/references/stable/metaparameter.html#require) metaparameter to make sure your SSH keys are present before the `vcsrepo` resource is applied: + +~~~ +vcsrepo { '/path/to/repo': + ensure => latest, + provider => cvs, + source => ':pserver:anonymous@example.com:/sources/myproj', + user => 'toto', #uses toto's $HOME/.ssh setup + require => File['/home/toto/.ssh/id_rsa'], +} +~~~ + +###Mercurial + +####Create a blank repository + +To create a blank repository, suitable for use as a central repository, define `vcsrepo` without `source` or `revision`: + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => hg, +} +~~~ + +####Clone/pull & update a repository + +To get the default branch tip: + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => hg, + source => 'http://hg.example.com/myrepo', +} +~~~ + +For a specific changeset, use `revision`: + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => hg, + source => 'http://hg.example.com/myrepo', + revision => '21ea4598c962', +} +~~~ + +You can also set `revision` to a tag: + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => hg, + source => 'http://hg.example.com/myrepo', + revision => '1.1.2', +} +~~~ + +To check out as a specific user: + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => hg, + source => 'http://hg.example.com/myrepo', + user => 'user', +} +~~~ + +To specify an SSH identity key: + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => hg, + source => 'ssh://hg@hg.example.com/myrepo', + identity => '/home/user/.ssh/id_dsa1, +} +~~~ + +To specify a username and password for HTTP Basic authentication: + +~~~ +vcsrepo { '/path/to/repo': + ensure => latest, + provider => hg, + source => 'http://hg.example.com/myrepo', + basic_auth_username => 'hgusername', + basic_auth_password => 'hgpassword', +} +~~~ + +####Connect via SSH + +To connect to your source repository via SSH (e.g., `'ssh://...'`), we recommend using the [`require` metaparameter](http://docs.puppetlabs.com/references/stable/metaparameter.html#require) to make sure your SSH keys are present before the `vcsrepo` resource is applied: + +~~~ +vcsrepo { '/path/to/repo': + ensure => latest, + provider => hg, + source => 'ssh://hg.example.com//path/to/myrepo', + user => 'toto', #uses toto's $HOME/.ssh setup + require => File['/home/toto/.ssh/id_rsa'], +} +~~~ + +###Perforce + +####Create an empty workspace + +To set up the connection to your Perforce service, set `p4config` to the location of a valid Perforce [config file](http://www.perforce.com/perforce/doc.current/manuals/p4guide/chapter.configuration.html#configuration.settings.configfiles) stored on the node: + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => p4, + p4config => '/root/.p4config' +} +~~~ + +**Note:** If you don't include the `P4CLIENT` setting in your config file, the provider generates a workspace name based on the digest of `path` and the node's hostname (e.g., `puppet-91bc00640c4e5a17787286acbe2c021c`): + +####Create/update and sync a Perforce workspace + +To sync a depot path to head, set `ensure` to 'latest': + +~~~ +vcsrepo { '/path/to/repo': + ensure => latest, + provider => p4, + source => '//depot/branch/...' +} +~~~ + +To sync to a specific changelist, specify its revision number with the `revision` parameter: + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => p4, + source => '//depot/branch/...', + revision => '2341' +} +~~~ + +You can also set `revision` to a label: + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => p4, + source => '//depot/branch/...', + revision => 'my_label' +} +~~~ + +###Subversion + +####Create a blank repository + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => svn, +} +~~~ + +####Check out from an existing repository + +Provide a `source` pointing to the branch or tag you want to check out: + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => svn, + source => 'svn://svnrepo/hello/branches/foo', +} +~~~ + +You can also designate a specific revision: + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => svn, + source => 'svn://svnrepo/hello/branches/foo', + revision => '1234', +} +~~~ + +####Use a specific Subversion configuration directory + +Use the `configuration` parameter to designate the directory that contains your Subversion configuration files (typically, '/path/to/.subversion'): + +~~~ +vcsrepo { '/path/to/repo': + ensure => present, + provider => svn, + source => 'svn://svnrepo/hello/branches/foo', + configuration => '/path/to/.subversion', +} +~~~ + +####Connect via SSH + +To connect to your source repository via SSH (e.g., `'svn+ssh://...'`), we recommend using the [`require` metaparameter](http://docs.puppetlabs.com/references/stable/metaparameter.html#require) to make sure your SSH keys are present before the `vcsrepo` resource is applied: + +~~~ +vcsrepo { '/path/to/repo': + ensure => latest, + provider => svn, + source => 'svn+ssh://svnrepo/hello/branches/foo', + user => 'toto', #uses toto's $HOME/.ssh setup + require => File['/home/toto/.ssh/id_rsa'], +} +~~~ + +##Reference + +###Type: vcsrepo + +The vcsrepo module adds only one type with several providers. Each provider abstracts a different VCS, and each provider includes a set of features according to its needs. + +####Providers + +**Note:** Not all features are available with all providers. + +#####`git` - Supports the Git VCS. + +Features: `bare_repositories`, `depth`, `multiple_remotes`, `reference_tracking`, `ssh_identity`, `submodules`, `user` + +Parameters: `depth`, `ensure`, `excludes`, `force`, `group`, `identity`, `owner`, `path`, `provider`, `remote`, `revision`, `source`, `user` + +#####`bzr` - Supports the Bazaar VCS. + +Features: `reference_tracking` + +Parameters: `ensure`, `excludes`, `force`, `group`, `owner`, `path`, `provider`, `revision`, `source` + +#####`cvs` - Supports the CVS VCS. + +Features: `cvs_rsh`, `gzip_compression`, `modules`, `reference_tracking`, `user` + +Parameters: `compression`, `cvs_rsh`, `ensure`, `excludes`, `force`, `group`, `module`, `owner`, `path`, `provider` + +#####`hg` - Supports the Mercurial VCS. + +Features: `reference_tracking`, `ssh_identity`, `user` + +Parameters: `ensure`, `excludes`, `force`, `group`, `identity`, `owner`, `path`, `provider`, `revision`, `source`, `user` + +#####`p4` - Supports the Perforce VCS. + +Features: `p4config`, `reference_tracking` + +Parameters: `ensure`, `excludes`, `force`, `group`, `owner`, `p4config`, `path`, `provider`, `revision`, `source` + +#####`svn` - Supports the Subversion VCS. + +Features: `basic_auth`, `configuration`, `conflict`, `depth`, `filesystem_types`, `reference_tracking` + +Parameters: `basic_auth_password`, `basic_auth_username`, `configuration`, `conflict`, `ensure`, `excludes`, `force`, `fstype`, `group`, `owner`, `path`, `provider`, `revision`, `source`, `trust_server_cert` + +####Features + +**Note:** Not all features are available with all providers. + +* `bare_repositories` - Differentiates between bare repositories and those with working copies. (Available with `git`.) +* `basic_auth` - Supports HTTP Basic authentication. (Available with `svn`.) +* `conflict` - Lets you decide how to resolve any conflicts between the source repository and your working copy. (Available with `svn`.) +* `configuration` - Lets you specify the location of your configuration files. (Available with `svn`.) +* `cvs_rsh` - Understands the `CVS_RSH` environment variable. (Available with `cvs`.) +* `depth` - Supports shallow clones in `git` or sets scope limit in `svn`. (Available with `git` and `svn`.) +* `filesystem_types` - Supports multiple types of filesystem. (Available with `svn`.) +* `gzip_compression` - Supports explicit GZip compression levels. (Available with `cvs`.) +* `modules` - Lets you choose a specific repository module. (Available with `cvs`.) +* `multiple_remotes` - Tracks multiple remote repositories. (Available with `git`.) +* `reference_tracking` - Lets you track revision references that can change over time (e.g., some VCS tags and branch names). (Available with all providers) +* `ssh_identity` - Lets you specify an SSH identity file. (Available with `git` and `hg`.) +* `user` - Can run as a different user. (Available with `git`, `hg` and `cvs`.) +* `p4config` - Supports setting the `P4CONFIG` environment. (Available with `p4`.) +* `submodules` - Supports repository submodules which can be optionally initialized. (Available with `git`.) + +####Parameters + +All parameters are optional, except where specified otherwise. + +##### `basic_auth_password` + +Specifies the password for HTTP Basic authentication. (Requires the `basic_auth` feature.) Valid options: a string. Default: none. + +##### `basic_auth_username` + +Specifies the username for HTTP Basic authentication. (Requires the `basic_auth` feature.) Valid options: a string. Default: none. + +##### `compression` + +Sets the GZIP compression level for the repository history. (Requires the `gzip_compression` feature.) Valid options: an integer between 0 and 6. Default: none. + +##### `configuration` + +Sets the configuration directory to use. (Requires the `configuration` feature.) Valid options: a string containing an absolute path. Default: none. + +##### `conflict` + +Tells Subversion how to resolve any conflicts between the source repository and your working copy. (Requires the `conflict` feature.) Valid options: 'base', 'mine-full', 'theirs-full', and 'working'. Default: none. + +##### `cvs_rsh` + +Provides a value for the `CVS_RSH` environment variable. (Requires the `cvs_rsh` feature.) Valid options: a string. Default: none. + +##### `depth` + +In `git` sets the number of commits to include when creating a shallow clone. (Requires the `depth` feature.) Valid options: an integer. Default: none. + +In `svn` instructs Subversion to limit the scope of an operation to a particular tree depth. (Requires the `depth` feature.) Valid options: 'empty', 'files', 'immediates', 'infinity'. Default: none. + +##### `ensure` + +Specifies whether the repository should exist. Valid options: 'present', 'bare', 'absent', and 'latest'. Default: 'present'. + +##### `excludes` + +Lists any files the repository shouldn't track (similar to .gitignore). Valid options: a string (separate multiple values with the newline character). Default: none. + +##### `force` + +Specifies whether to delete any existing files in the repository path if creating a new repository. **Use with care.** Valid options: 'true' and 'false'. Default: 'false'. + +##### `fstype` + +Sets the filesystem type. (Requires the `filesystem_types` feature.) Valid options: 'fsfs' or 'bdb'. Default: none. + +##### `group` + +Specifies a group to own the repository files. Valid options: a string containing a group name or GID. Default: none. + +##### `identity` + +Specifies an identity file to use for SSH authentication. (Requires the `ssh_identity` feature.) Valid options: a string containing an absolute path. Default: none. + +##### `module` + +Specifies the repository module to manage. (Requires the `modules` feature.) Valid options: a string containing the name of a CVS module. Default: none. + +##### `owner` + +Specifies a user to own the repository files. Valid options: a string containing a username or UID. Default: none. + +##### `p4config` + +Specifies a config file that contains settings for connecting to the Perforce service. (Requires the `p4config` feature.) Valid options: a string containing the absolute path to a valid [Perforce config file](http://www.perforce.com/perforce/doc.current/manuals/p4guide/chapter.configuration.html#configuration.settings.configfiles). Default: none. + +##### `path` + +Specifies a location for the managed repository. Valid options: a string containing an absolute path. Default: the title of your declared resource. + +##### `provider` + +*Required.* Specifies the backend to use for this vcsrepo resource. Valid options: 'bzr', 'cvs', 'git', 'hg', 'p4', and 'svn'. + +##### `remote` + +Specifies the remote repository to track. (Requires the `multiple_remotes` feature.) Valid options: a string containing one of the remote names specified in `source`. Default: 'origin'. + +##### `revision` + +Sets the revision of the repository. Valid options vary by provider: + +* `git` - a string containing a Git branch name, or a commit SHA or tag +* `bzr` - a string containing a Bazaar [revision spec](http://wiki.bazaar.canonical.com/BzrRevisionSpec) +* `cvs` - a string containing a CVS [tag or revision number](http://www.thathost.com/wincvs-howto/cvsdoc/cvs_4.html) +* `hg` - a string containing a Mercurial [changeset ID](http://mercurial.selenic.com/wiki/ChangeSetID) or [tag](http://mercurial.selenic.com/wiki/Tag) +* `p4` - a string containing a Perforce [change number, label name, client name, or date spec](http://www.perforce.com/perforce/r12.1/manuals/cmdref/o.fspecs.html) +* `svn` - a string containing a Subversion [revision number](http://svnbook.red-bean.com/en/1.7/svn.basic.in-action.html#svn.basic.in-action.revs), [revision keyword, or revision date](http://svnbook.red-bean.com/en/1.7/svn.tour.revs.specifiers.html) + +Default: none. + +##### `source` + +Specifies a source repository to serve as the upstream for your managed repository. Default: none. Valid options vary by provider: + +* `git` - a string containing a [Git repository URL](https://www.kernel.org/pub/software/scm/git/docs/git-clone.html#_git_urls_a_id_urls_a) or a hash of name => URL mappings. See also [`remote`](#remote). +* `bzr` - a string containing a Bazaar branch location +* `cvs` - a string containing a CVS root +* `hg` - a string containing the local path or URL of a Mercurial repository +* `p4` - a string containing a Perforce depot path +* `svn` - a string containing a Subversion repository URL + +Default: none. + +##### `submodules` + +Specifies whether to initialize and update each submodule in the repository. (Requires the `submodules` feature.) Valid options: 'true' and 'false'. Default: 'true'. + +##### `trust_server_cert` + +Instructs Subversion to accept SSL server certificates issued by unknown certificate authorities. Valid options: 'true' and 'false'. Default: 'false'. + +##### `user` + +Specifies the user to run as for repository operations. (Requires the `user` feature.) Valid options: a string containing a username or UID. Default: none. + +##Limitations + +Git is the only VCS provider officially [supported](https://forge.puppetlabs.com/supported) by Puppet Labs. + +This module has been tested with Puppet 2.7 and higher. + +The module has been tested on: + +* CentOS 5/6/7 +* Debian 6/7 +* Oracle 5/6/7 +* Red Hat Enterprise Linux 5/6/7 +* Scientific Linux 5/6/7 +* SLES 10/11/12 +* Ubuntu 10.04/12.04/14.04 + +Testing on other platforms has been light and cannot be guaranteed. + +##Development + +Puppet Labs modules on the Puppet Forge are open projects, and community contributions are essential for keeping them great. We can't access the huge number of platforms and myriad of hardware, software, and deployment configurations that Puppet is intended to serve. + +We want to keep it as easy as possible to contribute changes so that our modules work in your environment. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things. + +You can read the complete module contribution guide [on the Puppet Labs wiki.](http://projects.puppetlabs.com/projects/module-site/wiki/Module_contributing) -- cgit v1.2.3 From b8f25cea95317a4b2a622e2799f1aa7ba159bdca Mon Sep 17 00:00:00 2001 From: "Strech (Sergey Fedorov)" Date: Tue, 22 Dec 2015 23:02:26 +0100 Subject: Add mirror option for git cloning Example: vcsrepo { '/path/to/repo': ensure => mirror, provider => git, source => 'git://example.com/repo.git', } --- README.markdown | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'README.markdown') diff --git a/README.markdown b/README.markdown index e878891..ffc2d7e 100644 --- a/README.markdown +++ b/README.markdown @@ -94,6 +94,16 @@ vcsrepo { '/path/to/repo': } ~~~ +If you want to clone your repository as bare or mirror, you can set `ensure` to 'bare' or 'mirror': + +~~~ +vcsrepo { '/path/to/repo': + ensure => mirror, + provider => git, + source => 'git://example.com/repo.git', +} +~~~ + By default, `vcsrepo` will use the HEAD of the source repository's master branch. To use another branch or a specific commit, set `revision` to either a branch name or a commit SHA or tag. Branch name: -- cgit v1.2.3