We're going to make a copy of our existing Puppet repo, which we can then clone on a new machine.
Create a directory to hold the repo:
ubuntu@demo:~/puppet$ sudo mkdir /var/git
Clone the repo, using the
--bare
flag:ubuntu@demo:~/puppet$ cd /var/git ubuntu@demo:/var/git$ sudo git clone --bare /home/ubuntu/puppet Cloning into bare repository 'puppet.git'... done.
Now create a
git
user that will own the master repo and control access to it:ubuntu@demo:/var/git$ sudo useradd -d /var/git git ubuntu@demo:/var/git$ sudo chown -R git:git /var/git
Just to verify that these steps have worked, check out a temporary clone of the master repo:
ubuntu@demo:/tmp$ cd /tmp ubuntu@demo:/tmp$ git clone /var/git/puppet.git Cloning into 'puppet'... done. ubuntu@demo:/tmp$ ls puppet manifests modules ubuntu@demo:/tmp$ rm -r puppet
Now create a secure shell (SSH) keypair for the
git
user so that it can log in from remote machines to clone and update the Git repo. When...