I am new to Juju and trying to write a charm. I need ip address of all units deployed in a service. I am currently using juju 1.25 And deploying services in openstack
The scenario is:
I have 3 units of wordpress(it has required relation hook files) with
juju deploy -n 3 cs:wordpress
I deployed my charm from local repo
juju deploy local:trusty/myCharm
I add relation between the two
juju add-relation myCharm wordpress
Now, I need list of all 3 ip addresses of wordpress service in one of the hook in myCharm
I set relation-keys in wordpress and tried using relation-ids -> relation-list -> relation-get hook tools in myCharm. But it gives me just one ip and not all three.
relation-ids {relationName} --gives one id.
relation-list -r {id} --gives just one unit(wordpress/18).
relation-get -r {id} {relation-key} {unit} --gives corresponding ip.
What should I do to get expected result?