Go to file
Brian Waldon 267617ed1f Merge pull request #42 from bcwaldon/doc
doc(user-data): Move user-data doc to README.md
2014-03-20 10:50:40 -07:00
datasource refactor(*): Break apart packages 2014-03-18 09:14:11 -07:00
Documentation doc(user-data): Move user-data doc to README.md 2014-03-20 09:13:32 -07:00
initialize feat(unit.command): Add command field to units 2014-03-19 15:56:29 -07:00
src/github.com/coreos refactor(deps): Manage deps with goven 2014-03-12 19:49:02 -07:00
system feat(unit.command): Add command field to units 2014-03-19 15:56:29 -07:00
third_party refactor(deps): Manage deps with goven 2014-03-12 19:49:02 -07:00
.gitignore initial import 2014-03-04 16:36:05 -08:00
build initial import 2014-03-04 16:36:05 -08:00
coreos-cloudinit.go chore(release): Bump version to v0.2.1+git 2014-03-19 19:08:00 -07:00
README.md doc(user-data): Move user-data doc to README.md 2014-03-20 09:13:32 -07:00
test refactor(*): Break apart packages 2014-03-18 09:14:11 -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!'