Skip to content

Instantly share code, notes, and snippets.



Created Jun 25, 2014
What would you like to do?
Deploy Tomcat config and application contexts with Ansible!
- name: Copy Tomcat config(s)
template: src={{ item.src }} dest={{ item.dest }} mode={{ item.mode }} owner=root group=root
- { src: 'tomcat/server.xml.j2', dest: '/etc/tomcat7/server.xml', mode: '0644' }
- { src: 'tomcat/tomcat-users.xml.j2', dest: '/etc/tomcat7/tomcat-users.xml', mode: '0640' }
- restart tomcat7
tags: tomcat
- name: Prepare Tomcat web application contexts
template: src=tomcat/context.xml.j2 dest={{ item.context_path }}
with_items: dspace_webapps
when: dspace_webapps is defined
tags: tomcat

This comment has been minimized.

Copy link

@0x46616c6b 0x46616c6b commented Jun 25, 2014

I prefer the array like syntax instead of one liners of strings. For actions with a many arguments its much clearer.

- name: Copy Tomcat config(s)
    src: "{{ item.src }}"
    dest: "{{ item.dest }}"
    # ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment