Skip to content

Instantly share code, notes, and snippets.

@jeremyd
Created November 10, 2012 08:44
Show Gist options
  • Save jeremyd/4050477 to your computer and use it in GitHub Desktop.
Save jeremyd/4050477 to your computer and use it in GitHub Desktop.
PKGBUILD for cloud-init-bzr take 2
##
### Archlinux cloud.cfg - This config enables Archlinux tested/compatible cloud-init modules.
##
# Not using additional user / sudoers scheme.
disable_root: false
# Allow cloud-init to set the hostname.
preserve_hostname: false
# The modules that run in the 'init' stage.
cloud_init_modules:
- bootcmd
- write-files
- set_hostname
- update_hostname
- update_etc_hosts
- users-groups
- ssh
# The modules that run in the 'config' stage.
cloud_config_modules:
- runcmd
# The modules that run in the 'final' stage.
cloud_final_modules:
- rightscale_userdata
- scripts-per-once
- scripts-per-boot
- scripts-per-instance
- scripts-user
- ssh-authkey-fingerprints
- keys-to-console
- final-message
# Masquerade as ubuntu since that is the default mode.
system_info:
distro: ubuntu
paths:
cloud_dir: /var/lib/cloud/
templates_dir: /etc/cloud/templates/
ssh_svcname: sshd
pkgname=cloud-init-bzr
pkgver=723
pkgrel=1
pkgdesc="Bootstrap EC2 instances with Cloud-init from Canonical. Packaged from bzr trunk."
arch=(any)
license=("GPLv3")
url=https://launchpad.net/cloud-init
# cloud-init python lib requirements (according to Requires file):
# cheetah (aur), PrettyTable (aur), oauth (aur), boto (aur), configobj (community), pyyaml (community), argparse (aur)
# the ONLY non-match is we are using python2-yaml vs pyyaml.
depends=(systemd python2 python2-yaml python2-cheetah python2-prettytable python2-oauth2 python2-boto python2-argparse python2-configobj)
makedepends=('bzr' 'python2')
_bzrtrunk="lp:cloud-init"
_bzrmod="cloud-init"
# Archlinux specific cloud.cfg
source=(archlinux.cloud.cfg)
noextract=(archlinux.cloud.cfg)
sha1sums=(4e32767ac0e18f3b6f34cfb184af17c8a84d563c)
backup=(etc/cloud/cloud.cfg etc/cloud/cloud.cfg.d/05_logging.cfg)
build() {
cd $srcdir
msg "Connecting to Bazaar server..."
if [ -d $_bzrmod ]; then
cd ${_bzrmod} && bzr pull ${_bzrtrunk} -r ${pkgver}
msg "The local files are updated."
else
bzr branch ${_bzrtrunk} ${_bzrmod} -q -r ${pkgver}
cd $_bzrmod
fi
msg "Bazaar checkout done or server timeout"
python2 ./setup.py install --root=${pkgdir} --init-system systemd
}
package() {
# Use a cloud.cfg crafted for archlinux
mv $pkgdir/etc/cloud/cloud.cfg ${pkgdir}/etc/cloud/cloud.cfg.ubuntu_default
cp archlinux.cloud.cfg ${pkgdir}/etc/cloud/cloud.cfg
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment