2

I am trying to launch an aws ec2 instance with coreos, providing a cloud-config, which just ignores some parts like putting an rsa_private_key or runcmd. Anyway, the hostname has been set successfully though, so the config was basically processed.

I broke down the whole config to the most simple thing and validated it with the coreos validator which tells me Line 5:unrecognized key "runcmd".

#cloud-config

hostname: "node01"

runcmd:
  - touch /test.txt

I can't see any syntax error, what's wrong here?
For completeness, here's my whole cloud-config.yml: http://pastebin.com/YnrWqj7G

sgohl
  • 1,373
  • 1
  • 11
  • 16

1 Answers1

4

The original version of cloud-init is written in python.

CoreOS implemented their version in Go and it doesn't support all the same features. In fact, it also supports things that the python version doesn't that relate specifically to CoreOS. runcmd is not one of the supported features.

What is supported is listed here.

To run a cmd you'd have to drop in a unit file and run that.

hookenz
  • 14,132
  • 22
  • 86
  • 142
  • naahrg, didn't consider that -.- I'll try to use units. thanks! – sgohl Oct 22 '15 at 09:03
  • can you perhaps tell how I can make it to only execute actions via units at initialization time? (not everytime the machine boots up) – sgohl Oct 22 '15 at 09:13