Go to file
Brandon Philips 799c02865c Merge pull request #96 from philips/locksmith-support
Add locksmith support v2
2014-05-06 21:00:44 -07:00
datasource feat(proc-cmdline): Parse /proc/cmdline for cloud-config-url 2014-04-22 16:38:01 -07:00
Documentation feat(initialize): add locksmith configuration 2014-05-06 20:57:28 -07:00
initialize fix(initialize): use REBOOT_STRATEGY in update.conf 2014-05-06 20:57:29 -07:00
src/github.com/coreos refactor(deps): Manage deps with goven 2014-03-12 19:49:02 -07:00
system feat(system): add MaskUnit to systemd 2014-05-06 17:46:16 -07:00
third_party bump(github.com/coreos/go-systemd/dbus): 4fbc5060a317b142e6c7bfbedb65596d5f0ab99b 2014-03-25 19:37:05 -07:00
units Merge pull request #87 from marineam/hack 2014-04-23 14:54:19 -07:00
.gitignore initial import 2014-03-04 16:36:05 -08:00
build initial import 2014-03-04 16:36:05 -08:00
CONTRIBUTING.md chore(contributing): clean up CONTRIBUTING.md and split out DCO 2014-04-04 10:40:37 -07:00
coreos-cloudinit.go chore(release): Bump version to v0.5.2+git 2014-05-05 14:09:08 -07:00
DCO chore(contributing): clean up CONTRIBUTING.md and split out DCO 2014-04-04 10:40:37 -07:00
LICENSE feat(*): initial commit 2014-01-19 12:25:11 -08:00
NOTICE feat(*): initial commit 2014-01-19 12:25:11 -08:00
README.md doc(fields): Document field substitution 2014-03-21 14:36:12 -07:00
test feat(proc-cmdline): Parse /proc/cmdline for cloud-config-url 2014-04-22 16:38:01 -07:00

coreos-cloudinit

coreos-cloudinit enables a user to customize CoreOS machines by providing either a cloud-config document or an executable script through user-data.

Configuration with cloud-config

A subset of the official cloud-config spec is implemented by coreos-cloudinit. Additionally, several CoreOS-specific options have been implemented to support interacting with unit files, bootstrapping etcd clusters, and more. All supported cloud-config parameters are documented here.

The following is an example cloud-config document:

#cloud-config

coreos:
    units:
      - name: etcd.service
        command: start

users:
  - name: core
    passwd: $1$allJZawX$00S5T756I5PGdQga5qhqv1

write_files:
  - path: /etc/resolv.conf
    content: |
        nameserver 192.0.2.2
        nameserver 192.0.2.3

Executing a Script

coreos-cloudinit supports executing user-data as a script instead of parsing it as a cloud-config document. Make sure the first line of your user-data is a shebang and coreos-cloudinit will attempt to execute it:

#!/bin/bash

echo 'Hello, world!'

user-data Field Substitution

coreos-cloudinit will replace the following set of tokens in your user-data with system-generated values.

Token Description
$public_ipv4 Public IPv4 address of machine
$private_ipv4 Private IPv4 address of machine

These values are determined by CoreOS based on the given provider on which your machine is running. Read more about provider-specific functionality in the CoreOS OEM documentation.

For example, submitting the following user-data...

#cloud-config
coreos:
    etcd:
        addr: $public_ipv4:4001
        peer-addr: $private_ipv4:7001

...will result in this cloud-config document being executed:

#cloud-config
coreos:
    etcd:
        addr: 203.0.113.29:4001
        peer-addr: 192.0.2.13:7001