write puppet config to clone github repo

I’ve written a Puppet module to install Git on Windows. The Puppet Master is Linux.

Is it possible to write a Puppet manifest to clone a GitHub repo using just puppet resources (i.e. without a script or exec)?

  • How do I cleanly and conflict-free revert all changes made to a repository from a given point forwards? Things are on fire and I'm in a hurry
  • Using git push from Qt Creator
  • Submodule libraries in git to minimize redundancy
  • What is the difference between “git submodule foreach git pull origin master” and “git pull origin master --recurse-submodules”
  • How to apply a patch using git without configuration
  • Is it possible to configure git mergetool to avoid .orig for a given merge tool?
  • This is a private repo, so the solution needs to include secure credentials.

  • Migrating an SVN repository to some distributed VCS (Git or Mercurial)
  • Capistrano error - Invalid options(s): known_hosts
  • Window Git $ git config --global http.proxy warning: http.proxy has multiple values
  • How to use same folder for multiple git repos?
  • Git pull and merge during a merge
  • how to find out list of all changed files in git for full jenkins build and not for a particular commit?
  • One Solution collect form web for “write puppet config to clone github repo”

    It is indeed possible on Windows! You can use the puppetlabs-vcsrepo module

    Example of it in action
    Screenshot using a Windows 2012R2 machine in Virtualbox, command-line on the left, GUI on the right.

    Code I used in the example:

    vcsrepo { 'C:\foo':
      ensure   => present,
      provider => git,
      source   => 'https://github.com/puppetlabs/puppetlabs-vcsrepo',
    }
    

    To keep the repository at the latest revision, set ensure to ‘latest’.
    However, this overwrites any local changes to the repository.

    vcsrepo { 'C:\foo':
      ensure   => present,
      provider => git,
      source   => 'https://github.com/puppetlabs/puppetlabs-vcsrepo',
    }
    

    To control what ref, tag, or branch the git repo is on, use the ref parameter:

    vcsrepo { 'C:\foo':
      ensure   => present,
      provider => git,
      source   => 'git://example.com/repo.git',
      revision => 'development',
    }
    
    vcsrepo { 'C:\foo':
      ensure   => present,
      provider => git,
      source   => 'git://example.com/repo.git',
      revision => '0c466b8a5a45f6cd7de82c08df2fb4ce1e920a31',
    }
    
    vcsrepo { 'C:\foo':
      ensure   => present,
      provider => git,
      source   => 'git://example.com/repo.git',
      revision => '1.1.2rc1',
    }
    
    Git Baby is a git and github fan, let's start git clone.