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.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
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.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.