Skip to content

Instantly share code, notes, and snippets.

@johnl
Last active October 7, 2015 07:38
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save johnl/3129203 to your computer and use it in GitHub Desktop.
Save johnl/3129203 to your computer and use it in GitHub Desktop.
puppet-git-receiver cloud-config install script
$ brightbox-servers create --user-data="#include https://gist.githubusercontent.com/johnl/3129203/raw/d4b591546f1987803771bbc8c303c62cbca93538/puppet-git-receiver-install" img-9h5cv
Creating a nano (typ-4nssg) server with image Ubuntu Precise 12.04 LTS server (img-9h5cv) with 0.10k of user data
id status type zone created_on image_id cloud_ip_ids name
-----------------------------------------------------------------------------
srv-3te8u creating nano gb1-a 2012-07-17 img-9h5cv
-----------------------------------------------------------------------------
$ git init
Initialized empty Git repository in /home/john/tmp/puppet-git-receiver-test/
$ mkdir manifests
cat <<EOF > manifests/site.pp
package { ["pwgen","zip","cowsay"]:
ensure => installed
}
EOF
$ git add manifests/site.pp
$ git commit -m "install some packages"
$ git remote add srv-3te8u puppet-git@ipv6.srv-3te8u.gb1.brightbox.com:puppet.git
$ git push -u srv-3te8u master
The authenticity of host 'ipv6.srv-3te8u.gb1.brightbox.com (2a02:1348:14c:16b8:24:19ff:fef0:5ae2)' can't be established.
ECDSA key fingerprint is a3:13:ee:ef:05:d9:44:be:8e:0a:5c:4d:55:c3:42:3a.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'ipv6.srv-3te8u.gb1.brightbox.com,2a02:1348:14c:16b8:24:19ff:fef0:5ae2' (ECDSA) to the list of known hosts.
Counting objects: 12, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (12/12), 921 bytes, done.
Total 12 (delta 0), reused 0 (delta 0)
remote: *** Validating puppet manifests for refs/heads/master
remote: *** Applying puppet manifests
remote: notice: /Stage[main]//Package[pwgen]/ensure: ensure changed 'purged' to 'present'
remote: notice: /Stage[main]//Package[zip]/ensure: ensure changed 'purged' to 'present'
remote: notice: /Stage[main]//Package[cowsay]/ensure: ensure changed 'purged' to 'present'
remote: notice: Finished catalog run in 6.50 seconds
remote: *** Puppet manifests applied successfully
To puppet-git@ipv6.srv-3te8u.gb1.brightbox.com:puppet.git
* [new branch] master -> master
Branch master set up to track remote branch master from srv-3te8u.
#cloud-config
apt_sources:
- source: "ppa:brightbox/puppet"
packages:
- puppet-git-receiver
runcmd:
- cp -ar /home/ubuntu/.ssh /var/lib/puppet-git-receiver/
- chown -R puppet-git.puppet-git /var/lib/puppet-git-receiver/.ssh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment