Hi,
I'm sorry, I do not understand your question. As you have not gotten
any answers yet, it might be others have not understood it, too.
What you outline above is part of a hosts file. But where do you want
to define the ip? And what should it be used for?
Do you want to iterate/loop over all members of your group my-role?
That can be done. See the example in the docs:
https://docs.ansible.com/ansible/playbooks_loops.html#id29
Johannes