Skip to content

Instantly share code, notes, and snippets.

@dutchiechris
Last active December 21, 2017 03:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dutchiechris/e5689a526d4651f6dec4880230fe3c89 to your computer and use it in GitHub Desktop.
Save dutchiechris/e5689a526d4651f6dec4880230fe3c89 to your computer and use it in GitHub Desktop.
Example CoreOS cloud-config file (referenced from http://www.beginswithdata.com/2016/12/30/centos7-kvm-coreos/)
#cloud-config
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAgEAt4qwYNjFYPnPJObaNC+VoMYBFcEuUzCCBw6YzcU5f27bm0AwKvZKbVbwCo7IJ7gpNP0tIKvDK9z/qRQmcjWlW9p/cqpCa2a1fb0+8O2BhFXaD0BxuZWeuX8SF+mfJ2NzhgpTnR= kvm
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCh1LOHY/929X7qVXqpFQZRJt4uz3rkLVaCHdVD57Y+CEXjEQpoDBBdD6AEkPCvJ+vzFm9LC6KKUFVS7VXxZRUvXvKSWTKUrdsYV9vhNRLFGXYwzyUJov05w+/fxlels/L5Zc== coreos
hostname: @@VMNAME@@
users:
- name: "core"
passwd: "$6$rounds=4096$z2H2MkliS3J$c4hDSsKR3dkdkdjKKEK88dQdUhbS0gxKgAjNmUVRrgYOxMbvygrtrXr8QvFTeqfxAe1/M62O/CdyaNxaFgWu/"
coreos:
update:
reboot-strategy: off
units:
- name: systemd-networkd.service
command: stop
- name: static.network
runtime: true
content: |
[Match]
Name=eth0
[Network]
Address=@@IP@@/24
Gateway=10.64.28.1
DNS=10.64.28.200
- name: down-interfaces.service
command: start
content: |
[Service]
Type=oneshot
ExecStart=/usr/bin/ip link set eth0 down
ExecStart=/usr/bin/ip addr flush dev eth0
- name: systemd-networkd.service
command: restart
@seecsea
Copy link

seecsea commented Nov 24, 2017

https://coreos.com/validate/

Validation Results:

Config Invalid!
Document: incorrect type for "" (want struct)
Line: 6found character that cannot start any token

@seecsea
Copy link

seecsea commented Dec 21, 2017

hostname: "@@VMNAME@@"
all ok now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment