useful_scripts/get_all_ips.sh
2021-10-12 20:24:31 +01:00

10 lines
354 B
Bash
Executable File

#!/bin/bash
juju_status=$(mktemp)
juju status --format json > $juju_status
cat ${juju_status} | jq -rc '.machines | to_entries[] |[.key,.value.hostname,.value."ip-addresses"]'
cat ${juju_status} | jq -rc '.machines | to_entries[] | select(.value.containers != null ) | .value.containers | to_entries[] | [.key,.value.hostname,.value."ip-addresses"]'