I have a playbook that runs on all database servers, gathers information
about every database found, does error checking and eliminated duplicates
(same db on mulitple servers). The result is an output file that contains
three fields for every database "DBNAME SCRIPTNAME HOSTNAME"
Next I want to read every line in that local file, connect to only those
hosts specified, and run the script providing the dbname as an argument.
How can I read that dynamic local file and populated multiple variables
for additional use?
Example file
ProdDB script1.sh host1
DevDB script47.sh host4
I want to do something like this
- name: retrieve tablespace data
shell: /path/{{ scriptname }} {{ dbname }}
delegate_to: {{ hostname }}
with items from file local.generated where field 1 is dbname, field 2
is scriptname, and field 3 is hostname
register: tablespace_data
whether or not I use delegate_to, or call another playbook with extra vars,
I still need to populate variables based on their position in a 1-n row
text file. Any ideas how I can pull something like that off?
--
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/4d72f74d-b895-4805-9594-b41406c559a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.