I have a dilemma: I've got a module that can produce list of sites that given app is configured to serve, "app_info" which produces JSON output like this:
"site_info": {
"some.site.com": {
"dataroot": "/var/lib/app-instances/some_site",
"dbname": "some_site",
"ip": "1.2.3.4",
"status": "No"
},
so I'm collecting this data from the "[web]" servers using "data_collect"
role:
- name: collect sites info
app_info: list
register: site_info
- debug: var=site_info
- name: register sites
add_host: name={{ item.key }} group=sites {{ item.value }}
with_dict: site_info
as you can see I'm trying to initialize new group "sites" which is working
fine, except population of variables per site. How can I grab vars from
site_info for specific site and populate that site's "facts" with them in
the most efficient way? set_fact seems to be cumbersome a bit, can I
somehow convince add_host to take already arranged vars and assign them to
my site?
--
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/f3ebbd7a-31ec-40c5-ba52-622ea9c3072a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
