Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translation of host-specific data based upon group and position #152

Closed
herlo opened this issue Feb 14, 2017 · 3 comments
Closed

Translation of host-specific data based upon group and position #152

herlo opened this issue Feb 14, 2017 · 3 comments

Comments

@herlo
Copy link
Contributor

herlo commented Feb 14, 2017

Use Case:

Create a variable that all hosts can read based upon a specific host from a specific group. So for example, it might look like so:

---
inventory_layout:
  vars:
    xyz_some_data: __groupA[0].IP__
  host-groups:
    groupA:
      count: 3
      vars:
         debug: yes

This was a specific use case was something provided by @mprahl and @Dlane. They will comment with a more specific example.

@herlo
Copy link
Contributor Author

herlo commented Feb 14, 2017

Additionally, translating any VALUE throughout the layout file would prove useful. Limiting the options to a host-group or global vars section also seems logical at this time. This would mean that translation of sub items (like children) or vars inside a group would not be available.

@herlo herlo added this to the v1.0.0 milestone Feb 14, 2017
@herlo herlo self-assigned this Feb 14, 2017
@mprahl
Copy link

mprahl commented Feb 16, 2017

Our use case is in our test deployment of ResultsDB and ResultsDB Frontend. This requires three VM's: one for the database, one for ResultsDB, and one for ResultsDB Frontend. ResultsDB needs the IP address (or FQDN in production) of the database server to know how to connect to it. The playbooks expect the variable resultsdb_db_host to have this value. Additionally, ResultsDB Frontend needs to know the IP address (or FQDN in production) of the ResultsDB server to know where to make REST API calls. The playbooks expect the variable resultsdb_host to have this value.

With that being said, we currently have to scrape the data from the generated inventory file or an output file with JSON from linch-pin to get these IP addresses. Afterwards, we create an Ansible variable file with those variables defined that the playbooks use.

It would be nice to just be able to define those variables natively with linch-pin.

@herlo
Copy link
Contributor Author

herlo commented Mar 21, 2017

Fixed by #157

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

No branches or pull requests

2 participants