How to deal with "virtual" hostnames?

7 views
Skip to first unread message

Toni Mueller

unread,
May 28, 2020, 2:52:52 PM5/28/20
to ansible...@googlegroups.com

Hi,

I would like to create a data structure which resembles a (virtual)
host, but in a replicated fashion. Say, I have a number of nodes, and
now I want to create the same "vhost" on a subset of them, for
redundancy.

I'm having trouble expressing that in an inventory because only the
nodes exist, but the "vhost" not (obviously?). For ease of use, I would
rather not care about what or where the nodes actually are, but treat
those "vhosts" as hosts with an attribute like "place on these nodes: 1,
2, 3, ...".

If any given "vhost" would have to be placed on only one node, I'd just
set the 'ansible_host' variable accordingly.

What would be the best practice for this use case?

I am using Ansible 2.8 and 2.9, if that helps.


Thank you!


Cheers,
Toni
Reply all
Reply to author
Forward
0 new messages