Logilab logo

Previous topic

salt-ami-cloud-builder’s documentation

Next topic

Run salt-ami-cloud-builder in a cloud image

This Page

Using salt-ami-cloud-builder on a local machine

This should only be used is no machine is available. If an salt-ami-cloud-builder image is already available, juste launch it with the necessary user data:

  1. ami.type: ubuntu
  2. a correct source/md5sum for an ubuntu image
  3. use the server repository as variation address.
  4. provide your correct credentials

This should create and upload an up to date custom AMI image

On Ubuntu, the first step is to add the salt PPA to install it:

root@machine~# add-apt-repository -y ppa:saltstack/salt

The next step is to install salt-minion and mercurial:

root@machine~# aptitude update && aptitude install salt-minion mercurial

On CentOS, enable EPEL and install salt-minon & mercurial :

root@machine~# wget http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
root@machine~# rpm -Uvh epel-release-5-4.noarch.rpm
root@machine~# yum install salt-minion mercurial

Then, clone the server repository:

root@machine~# hg clone http://hg.logilab.org/master/salt-ami-cloud-builder/ /etc/salt/srv

Copy the necessary scripts so the ami creation process is launched at boot:

root@machine~# cp /etc/salt/srv/others/rc.local /etc/rc.local

and copy the configuration to make salt-minion masterless:

root@machine~# cp /etc/salt/srv/minion /etc/salt/

save this machine as an ami-creator image and you can then use it by simply adding relevant user data at boot