This gem allows to bootstrap CoreOS on a Hetzner root server.
In our case we are running a large CoreOS cluster and which uses bare metal servers hosted at Hetzner. This Ruby gem helps to fully automate the provisioning of CoreOS on a Hetzner root server.
Warning: All existing data on the system will be lost!
First of all retrieve your API login credentials from the Hetzner admin interface at https://robot.your-server.de. Additionally you need the IP address of the shipped system.
- Enable Rescue Mode (using Hetzner's webservice)
- Resetting the System to boot into rescue mode (using Hetzner's webservice)
- Log into the rescue system, write your cloud config file and launch the installation
- Reboot
- Verify installation (very basic check but can be overwritten)
- Copy your local ssh public-key into root's .authorized_keys
- Adds the generated server key into your
$HOME/.ssh/known_hosts
file - Execute
post_install
hooks (optional)
See example.rb
file for usage.
Warning: All existing data on the target system will be lost!
#!/usr/bin/env ruby
require "rubygems"
require "hetzner-bootstrap-coreos"
# Retrieve your API login credentials from the Hetzner admin interface
# at https://robot.your-server.de and assign the appropriate environment
# variables ENV['ROBOT_USER'] and ENV['ROBOT_PASSWORD']
bs = Hetzner::Bootstrap::CoreOS.new(
:api => Hetzner::API.new(ENV['ROBOT_USER'], ENV['ROBOT_PASSWORD'])
)
# Main configuration (cloud-config)
cloud_config = <<EOT
hostname: <%= hostname %>
ssh_authorized_keys:
- <%= public_keys %>
EOT
# The post_install hook is the right place to launch further tasks (e.g.
# software installation, system provisioning etc.)
post_install = <<EOT
# TODO
EOT
bs << { :ip => "1.2.3.4",
:cloud_config => cloud_config,
:hostname => 'artemis.massive-insights.com',
:public_keys => "~/.ssh/id_rsa.pub",
:post_install => post_install
}
bs.bootstrap!
gem install hetzner-bootstrap-coreos
- All existing data on the system will be wiped on bootstrap!
- This is not an official Hetzner AG project.
- The gem and the author are not related to Hetzner AG!
Use at your very own risk. Satisfaction is NOT guaranteed.
This Ruby gem is inspired by the hetzner-bootstrap gem and requires the underlying wrapper for the Hetzner server management API hetzner-api. Thus I want to thank Roland Moriz a lot for his great work!
Copyright © 2014 Christoph Pilka (Asconix Systems AS)