By Paul Dixon
Once you’ve booted a new CoreOS host on Digital Ocean, how can you update the cloud-config?
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!
@bgrayburn you can update ssh keys without doing anything crazy: https://github.com/coreos/init/blob/master/bin/update-ssh-keys
I have a script that I use to push them out across my fleet:
$ cat fleetctl-inject-ssh.sh
#!/bin/bash -x
# Usage:
# cat public.key | fleetctl-inject-ssh.sh keyname
name=$1
if [ -z $name ]; then
echo "Provide a name for the injected SSH key"
exit 1
fi
shift 1
pubkey=$(cat)
for machine in $(fleetctl -strict-host-key-checking=false $@ list-machines --no-legend --full | awk '{ print $1;}'); do
fleetctl -strict-host-key-checking=false $@ ssh $machine "echo '${pubkey}' | update-ssh-keys -a $name -n"
done
so to run you could do something like:
echo 'THE_CONTENTS_OF_PUBKEY' | ./fleetctl-inject-ssh.sh <SOME_INTELLIGENT_NAME_FOR_KEY>
or
cat <PUBKEY> | ./fleetctl-inject-ssh.sh <SOME_INTELLIGENT_NAME_FOR_KEY>
You can find the cloud-config in :
/var/lib/coreos-install/user_data for baremetal/var/lib/coreos-vagrant/vagrant-user-data for vagrantupdate it, reboot, if no error, the new configuration should be done. I don’t know if it’s the good way but it seems to work.
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.