I’ striving to get a working template of a #cloud-config file for Debian (Wheezy) - I have the following ATM:
#-------------------------------
#!/bin/bash
# - add wheezy-backports
echo "deb http://cdn.debian.net/debian 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 http://169.254.169.254/metadata/v1/hostname)
export PUBLIC_IPV4=$(curl -s http://169.254.169.254/metadata/v1/interfaces/public/0/ipv4/address)
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:
#cloud-config
disable_root: false
manage_etc_hosts: true
#.
#.
#.
runcmd:
- echo "deb http://cdn.debian.net/debian 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.
Thanks for your clear response. I suspect this is mainly due to systemd not being shipped by default? - or are there other factors?
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.