You are here
Ewurama - Thu, 2015/10/01 - 18:12
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
Forum:
TBH I know nothing about Ansible
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.
Creating multiple folders
@Ewurama, I don't think {1..3} is a valid syntax in yaml. Perhaps you were thinking of Ruby or similar language. Instead you can use 'with_sequence' like this
After running ansible-playbook tomcat.yml (above)
I don't know enough about Tomcat to help with the remainer of your question, but perhaps you can find some clues by reading some of the Ansible Tomcat modules developed by others. E.g. see https://github.com/silpion/ansible-tomcat
Information is free, knowledge is acquired, but wisdom is earned.
Experimenting with Ansible Galaxy
@Ewurama, You could also try experimenting the some of the Tomcat roles defined on Ansible Galaxy
Information is free, knowledge is acquired, but wisdom is earned.
Add new comment