Created
June 3, 2019 22:25
-
-
Save niedbalski/c6bc61ec836a1ec55bbfd9336c4f228e to your computer and use it in GitHub Desktop.
check that memcached is reacheable from ncc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # ./{0} nova-cloud-controller | |
| units=$(juju status $1 | grep -E '[a-z\-]+\/[0-9]+' | awk '{print $1}' | sed s'/.$//') | |
| for unit in ${units}; do | |
| relations=$(juju run --unit ${unit} 'relation-ids memcache') | |
| for relation in ${relations}; do | |
| unit_list=$(juju run --unit ${unit} "relation-list -r ${relation}") | |
| for related in ${unit_list}; do | |
| addr=$(juju run --unit ${unit} "relation-get -r ${relation} private-address ${related}") | |
| juju run --unit ${unit} "nc -vz -t ${addr} 11211" | |
| done | |
| done | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment