Hi Nicola, On 13.06.19 15:06, Nicola Contu wrote: > As I have too many vhosts to be created, I got a file from where I would > like to read content, iterate it, populate variables and push the file. > > The file is like this : > 5;yyy;yyyyy > 70;zzzz;zzz > > I can modify the file to include the header, to be , delimited.. whatever.
Since this is basically a CSV file, you might have a look at the read_csv module. https://docs.ansible.com/ansible/latest/modules/read_csv_module.html This is only available in Ansible 2.8 though, for older versions you might use the csvfile lookup. https://docs.ansible.com/ansible/latest/plugins/lookup/csvfile.html Regards Sebastian -- Sebastian Meyer Linux Consultant & Trainer Mail: [email protected] B1 Systems GmbH Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537 -- 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/51ca1b5c-84dc-6b52-8d5a-221b44725d1a%40b1-systems.de. For more options, visit https://groups.google.com/d/optout.
