Basic cloud-config for Debian - NOT WORKING!

Posted January 14, 2015 5k views

I’ striving to get a working template of a #cloud-config file for Debian (Wheezy) - I have the following ATM:

# - add wheezy-backports  
echo "deb wheezy-backports main" > /etc/apt/sources.list.d/wheezy-full.list
apt-get -y update && apt-get -y upgrade
apt-get install -y apache2 haproxy php5 php5-memcached php5-mysqlnd php5-adodb php5-gd php-apc php5-pgsql rubygems ruby-full rkhunter lynis htop mc tmux rcconf tree nload screen nmap 
 #DigitalOcean Specific GET HOST details
export HOSTNAME=$(curl -s
export PUBLIC_IPV4=$(curl -s
echo "created @ $(date) local machine time <br> $HOSTNAME, IP Address: $PUBLIC_IPV4 <br> THANK YOU! cloud-config." > /var/www/index.html

However it seems to be having no effect when entering it within “User Data” upon Droplet creation. Using the API’s I’m able to see that the “User-Data” is indeed registered.

I’ve also tried the above with other cloud-config yaml blocks eg:

disable_root: false
manage_etc_hosts: true
 - echo "deb wheezy-backports main" > /etc/apt/sources.list.d/wheezy-full.list
 - apt-get -y update

But no luck.

Any suggestions / help would be well appreciated.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers

Unfortunately, Debian 7 does not have a recent enough release of cloud-init for us to support it. So our Debian 7 images do not have it installed. While the meta-data service is still available, cloud-init will not automatically process and run cloud-config scripts.

We plan on bringing support to for cloud-init when Debian 8 is release. Fingers crossed, but it the release seems to be making good progress and should be out in the next few months.

Thanks for your clear response.
I suspect this is mainly due to systemd not being shipped by default? - or are there other factors?

  • We were required to write our own “data source” for cloud-init We based our work on the upstream version 0.7.5, and our changes were merged upstream in revision 128. So while it may be possible to backport it to older releases we made the decision to only add it to distributions which have at least version 0.7.5 So new releases will pick it up. For instance, Fedora 21 was just released. We now offer cloud-init on that images, but not older Fedora images.

    If using cloud-config scripts is essential for you and you are feeling a bit ambitious, it might be possible to install cloud-init from source and take a snapshot. Though that’s not something I’ve tried personally.