As we have already seen in the decentralized model, Git can be used to transfer files between machines using a combination of ssh
and ssh
keys. It can also be useful to have a Git hook do the same on each successful commit to the repository.
There is a hook, called postcommit
, that can be run after a successful commit to the repository. In this recipe, we'll create a hook that updates the code on our Puppet master with code from our Git repository on the Git server.
Follow these steps to get started:
vagrant@git:~$ sudo -iu git $ ssh-keygen -f ~/.ssh/puppet_rsa Generating public/private rsa key pair. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/git/.ssh/puppet_rsa. Your public key has been saved in /home/git/.ssh/puppet_rsa.pub. The key fingerprint...