Skip to content

Instantly share code, notes, and snippets.

Created June 25, 2014 11:33
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
Copy link

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