Skip to content

Instantly share code, notes, and snippets.

@burythehammer
Last active January 23, 2017 17:25
Show Gist options
  • Save burythehammer/081d6ee11cc33c2f4c4729ae67622f5b to your computer and use it in GitHub Desktop.
Save burythehammer/081d6ee11cc33c2f4c4729ae67622f5b to your computer and use it in GitHub Desktop.
Running Goss on a remote server
# run this file to install goss onto a remote target and run a test script on it
# example usage:
# ./goss-test.sh 34.248.91.167
TARGET='centos@'$1 # change user as required - this is for centos
SSH_KEY_PATH=~/.ssh/aws # change ssh key as required
ssh -t -t -i $SSH_KEY_PATH $TARGET 'curl -fsSL https://goss.rocks/install | sudo sh'
scp ./goss.json $TARGET:~/goss.yaml
ssh -t -t -i $SSH_KEY_PATH $TARGET 'goss validate'
{
"package": {
"etcd": {
"installed": true,
"versions": [
"2.3.7"
]
}
},
"service": {
"etcd": {
"enabled": true,
"running": true
}
},
"user": {
"centos": {
"exists": true,
"uid": 1000,
"gid": 1000,
"groups": [
"adm",
"centos",
"systemd-journal",
"wheel"
],
"home": "/home/centos",
"shell": "/bin/bash"
},
"etcd": {
"exists": true,
"uid": 995,
"gid": 992,
"groups": [
"etcd"
],
"home": "/var/lib/etcd",
"shell": "/sbin/nologin"
}
},
"group": {
"centos": {
"exists": true,
"gid": 1000
},
"etcd": {
"exists": true,
"gid": 992
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment