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.