Forum archive
How to create multiple folders with loop in ansible
I am trying to create multiple directories with different names e.g tomacat-1, tomcat-2 etc..
But i want to do this in the form of a loop. Kindly help me with the yaml syntax.
this is what i tried
- name: Creating multiple tomcat instance
file: dest=/var/lib/tomcat-instance{1..3} state=directory
But instead of creating three directories, it creates only one with name "tomcat-instance{1..3}"
Also i would like each of these folders to have a unique port id and shutdown port e.g -p 8000 -c 8006
In the meantime eprhaps google might help? Or ansible upstream may have forums and/or a mailing list where someone from there community could help you out.