Skip to content

Instantly share code, notes, and snippets.

@maxclaus
Created February 28, 2015 03:08
Show Gist options
  • Select an option

  • Save maxclaus/b93a118914caa9ea87ea to your computer and use it in GitHub Desktop.

Select an option

Save maxclaus/b93a118914caa9ea87ea to your computer and use it in GitHub Desktop.

Revisions

  1. @maxcnunes maxcnunes created this gist Feb 28, 2015.
    18 changes: 18 additions & 0 deletions update-coreos-cloud-config.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    #!/bin/bash
    SERVER_IP=<MY_SERVER_IP>

    # copy cloud-config.yml to the server
    scp cloud-config.yml core@$SERVER_IP:~/

    # validate cloud-config file
    ssh core@$SERVER_IP "coreos-cloudinit -validate --from-file ~/cloud-config.yml"

    if [[ $? == "0" ]]; then
    echo
    echo "Valid configuration"
    echo " Connect to the server and execute it as root user: "
    echo " coreos-cloudinit --from-file /home/core/cloud-config.yml"
    else
    echo
    echo "Invalid configuration"
    fi