Product SiteDocumentation Site

9.4. Implementation

The GIT module manages, or can manage, the following resources by class or type definition:
Classes
  • git::client
    The class to include to make a node a git client, and install the necessary packages. Including this class will install the git package.
  • git::server
    The class to include to make a node a git server, so that clients can clone, pull from and push to repositories on this server.
    Including the class will:
    1. install the git-daemon package,
    2. start the xinetd service and enable it on boot,
    3. start the git service and enable it on boot,
    4. create a /git/ directory for both the root of the git-daemon server daemon, and to enable pushing over ssh://server/git/reponame/.
    5. copy a bash script, /usr/local/bin/git_init_script, to the node, to enable repositories to be created from within puppet, using the git::repository definition. See also Section 9.5.1, “Customizing git_init_script.
Type Definitions
  • git::clone
    The git::clone type performs exactly what it describes. It clones a repository given a source location and, optionally, a target directory. Possible parameters include
    • source
      Source URI of the repository to clone. This may be an absolute path for a locally available repository, or any of the following URI locators: http://, git://, ssh://
      Possible values: An absolute path, or any of the following URI locators: http://, git://, ssh://
      Default value: false
    • localtree
      The local tree (or cwd) in which the cloned repository is supposed to end up.
      Possible values: Any absolute path
      Default value: /srv/git/
    • real_name
      The real name of the GIT repository. Because two repositories that may both be named "foo", the real_name attribute allows you to specify the real name of the tree without creating conflicts between two different equally named git repositories (to clone).
      The real name is applied as follows: When cloning, git::clone will take the repository source url and the name of the directory to clone to. When cloning a git repository called 'puppet-module-git' for example, which needs to end up as /var/lib/puppet/modules/git/ maybe, setting real_name => "git" will cause git::clone to clone the 'puppet-module-git' repository into the 'git' directory below localtree.
    • branch
      To have the clone action checkout a specific branch, specify branch.
      Possible values: false, or any available branch in the git repository.
      Default value: false
    See also:
  • git::pull
    • localtree
      The local tree (or cwd) the pull is performed in. Note that the name (or real_name, if specified) of the resource is supposed to be the sub-directory of localtree. The actual git pull is then performed in $localtree/$name/, or $localtree/$real_name/ if real_name is specified.
    • real_name
      The real name of the GIT repository. Because two repositories that may both be named "foo", the real_name attribute allows you to specify the real name of the tree without creating conflicts between two different equally named git repositories (to pull from).
      The real name is applied as follows: When pulling, git::pull will navigate into the directory $localtree/$real_name/, instead of the default $localtree/$name/.
    • reset
      This lets git::pull first reset the repository in order to avoid conflicts between any local changes that may not have been committed, and remote changes. Any changes to the local repository that have not been committed will be undone, except for files that are not tracked within the git repository.
      When performing a git reset, by default the git::reset resource also performs a git::clean, unless clean is set to false.
      Possible values: true, false
      Default value: true
    • clean
      This lets git::pull first clean the repository (using git::clean) in order to avoid conflicts between any local changes that may not have been committed, and remote changes. Any changes to the local repository that have not been committed will be undone, except for files that are not tracked within the git repository.
      Possible values: true, false
      Default value: true
    • branch
      If specified, causes git::pull to perform a tracking git checkout of the branch if necessary.
      Possible values: false, or any existing branch
      Default value: false
    Note that a git::pull depends on a successful git::clone and will perform a git::clone if the local clone has not already been performed.
  • git::reset
    • localtree
      The local tree (or cwd) the reset is performed in. Note that the name (or real_name, if specified) of the resource is supposed to be the sub-directory of localtree. The actual git reset is then performed in $localtree/$name/, or $localtree/$real_name/ if real_name is specified.
    • real_name
      The real name of the GIT repository. Because two repositories that may both be named "foo", the real_name attribute allows you to specify the real name of the tree without creating conflicts between two different equally named git repositories (to reset).
    • clean
      para
    See also:
  • git::clean
    • localtree
      The local tree (or cwd) the clean is performed in. Note that the name (or real_name, if specified) of the resource is supposed to be the sub-directory of localtree. The actual git clean is then performed in $localtree/$name/, or $localtree/$real_name/ if real_name is specified.
    • real_name
      The real name of the GIT repository. Because two repositories that may both be named "foo", the real_name attribute allows you to specify the real name of the tree without creating conflicts between two different equally named git repositories (to clean).
    See also:
  • git::repository
    Available parameters:
    • public
      Whether this repository is public (e.g. world readable) or not.
      Possible values: true, false.
      Default value: false
    • shared
      Whether this repository is shared (e.g. group writeable) or not. This impacts the group writeability as follows:
      find /path/to/repo -type f -exec chmod g+w {} \;
      find /path/to/repo -type d -exec chmod g+ws {} \;
      
      Possible values: true, false.
      Default value: false
    • localtree
      The directory in which to create this repository. Note that localtree sets the base directory. A new directory with the name of the repository will be created in the directory you specify as localtree. See also prefix.
      Possible values: Any directory that exists on the system.
      Default value: /srv/git/
    • owner
      The name of the user that owns the repository.
      Possible values: Any user on the system. If no user with username $owner exists, git::repository will create it.
      Default value: root
    • group
      The name of the group that owns the repository. The git::repository type definition also ensures that this group exists on the system, but adds no members to the group.
      Possible values: Any group on the system, or if a non-existent group is specified, the group will be created.
      Default value: root
    • symlink_prefix
      The symlink_prefix is prepended to the repository name when creating a symbolic link to the actual repository in the /git/ directory. See also prefix, and Section 9.6.1.1, “Using the symlink_prefix attribute”
      Possible values: Any alphanumeric string.
      Default value: false
    • prefix
      The prefix is prepended to the name of the repository. This creates a repository named $prefix-$name/ instead of $name/. See also symlink_prefix, and Section 9.6.1.2, “Using the prefix attribute”
      Possible values: Any alphanumeric string.
      Default value: false
    • real_name
      The real_name, if set, is used rather then the title of the instantiated git::repository type. Particularly useful when creating more then one git::repository with name "webserver", since the Git::Repository["webserver"] resource can only be created once.
      Possible values: Any alphanumeric string.
      Default value: false
    • recipients
      An array of recipients, that end up in the git repository's commit list, used to notify people of commits via email.
      Possible values: An array of email addresses.
      Default value: false
    • description
      The description of this repository.
      Possible values: Any description.
      Default value: false
    See also: