Not sure if this will make it clearer or muddier, here's the flow of you 
code. The playbook is in red, the resulting tasks executed are in blue.

What's you're currently doing:

- { role: tomcat7, dir: '/var/opt/tomcat_1/conf', server_port: 8105 }

  - name: Template to 1st server.xml
    template: src=server.xml.j2 dest=/var/opt/tomcat_1/conf/server.xml 
owner=tomcat7 group=nogroup mode=0600
 
  - name: Template to 2nd server.xml
    template: src=server.xml.j2 dest=/var/opt/tomcat_2/conf/server.xml 
owner=tomcat7 group=nogroup mode=0600


- { role: tomcat7, dir: '/var/opt/tomcat_2/conf', server_port: 8205 }

  - name: Template to 1st server.xml
    template: src=server.xml.j2 dest=/var/opt/tomcat_1/conf/server.xml 
owner=tomcat7 group=nogroup mode=0600
 
  - name: Template to 2nd server.xml
    template: src=server.xml.j2 dest=/var/opt/tomcat_2/conf/server.xml 
owner=tomcat7 group=nogroup mode=0600
    
  
What my suggestion will do:  
    
- { role: tomcat7, dir: '/var/opt/tomcat_1/conf', server_port: 8105 }

  - name: Template to server.xml
    template: src=server.xml.j2 dest=/var/opt/tomcat_1/conf/server.xml 
owner=tomcat7 group=nogroup mode=0600
    
    
- { role: tomcat7, dir: '/var/opt/tomcat_2/conf', server_port: 8205 }

  - name: Template to server.xml
    template: src=server.xml.j2 dest=/var/opt/tomcat_2/conf/server.xml 
owner=tomcat7 group=nogroup mode=0600

-- 
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/9ea300f5-b111-4141-a287-1e054aaeb2bf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to