The coreos-cloudinit
binary is CoreOS-specific, so this can only be done from a CoreOS host:
$ coreos-cloudinit -validate --from-file /tmp/cloud-config
After the system has been instaled, the cloud-config
file is written to /var/lib/coreos-install/user_data
:
$ sudo cat /var/lib/coreos-install/user_data
#cloud-config
hostname: coreos1
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCZr...
users:
- name: andy
groups:
- sudo
- docker
coreos-ssh-import-github: sublimino
...
Any changes to this file should be validated to prevent loss of access to the system on reboot.
$ coreos-cloudinit -validate --from-file /var/lib/coreos-install/user_data
Checking availability of "local-file"
Fetching user-data from datasource of type "local-file"
line 27: error: found a tab character where an intendation space is expected
line 0: warning: incorrect type for "" (want struct)
$ echo $?
1
After fixing that error, the cloud-config
file validates:
$ coreos-cloudinit -validate --from-file /var/lib/coreos-install/user_data
Checking availability of "local-file"
Fetching user-data from datasource of type "local-file"
$ echo $?
0