Let's assume I have a service that can listen on different combinations
or host/port:

---
host:
  service:
    listen:
    - ip: "2001:db8:1:2::1"
      port: "80"
    - ip: "2001:db8:1:2::1"
      port: "443"
    - ip: "192.0.1.2"
      port: "80"

let's also assume that the vast majority of cases use a rather simple
setup so that it would be tedious to write the standard configuration
over and over again, so it would be nice if one could just write:

---
host:
  service:
    hostname: "some-dns-name.example"
    ports:
    - "80"
    - "443"

I would then like to have some component of my ansible setup to go to
DNS, look up A and AAAA records for the DNS name and generate the
detailed listen configuration.

Given some-dns-name.example would have an A record of 192.0.1.40 and an
AAAA record of 2001:db8:1::40, the data structure built would be

---
host:
  service:
    listen:
    - ip: "2001:db8:1::40"
      port: "80"
    - ip: "2001:db8:1::40"
      port: "443"
    - ip: "192.0.1.40"
      port: "80"
    - ip: "192.0.1.40"
      port: "443"

so that the tasks and templates could always act as if the fully
detailed configuration were explicitly given, while giving the admin the
possibility to always write doen the fully detailed configuration
explicitly AND the ease of writing down the easier form for the standard
cases.

I could have a program read in the inventory, write out a temporary
inventory with the "augmented" host variables and then have ansible run
from this, but I hope that this won't be necessary...

Greetings
Marc


-- 
-----------------------------------------------------------------------------
Marc Haber         | "I don't trust Computers. They | Mailadresse im Header
Leimen, Germany    |  lose things."    Winona Ryder | Fon: *49 6224 1600402
Nordisch by Nature |  How to make an American Quilt | Fax: *49 6224 1600421

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/20200427081201.GE3628%40torres.zugschlus.de.

Reply via email to