Skip to content

Instantly share code, notes, and snippets.

@nottrobin
Created February 4, 2015 16:20
Show Gist options
  • Select an option

  • Save nottrobin/7b1ced13a0fccfeea44d to your computer and use it in GitHub Desktop.

Select an option

Save nottrobin/7b1ced13a0fccfeea44d to your computer and use it in GitHub Desktop.
Get the instance ID for the first machine used by a juju service
#!/usr/bin/env bash
# Get the instance ID for a juju machine, by machine number
# Requires:
# - `jq` (http://stedolan.github.io/jq/)
# - `juju-first-machine-number.sh` (https://gist.github.com/nottrobin/9e7ff961cc6c00a65c61)
# - `juju-instance-id.sh` (https://gist.github.com/nottrobin/f918f98a8e1e20803b5f)
# Usage:
# $ juju-first-instance-id.sh my-awesome-service
# 92e3ef6a-ba3d-4eb4-adbc-8be78f2c8abe
service_name=${1}
juju-instance-id $(juju-first-machine-number ${service_name})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment