#
# Configure Tomcat
#

- name: generate a custom "setenv.sh" from template, provides the ability to configure Tomcat at start-up from outside the container
  template:
    src: setenv.sh.j2
    dest: "{{ tomcat_catalina_base }}/bin/setenv.sh"
    mode: ug+x

- name: "generate a custom 'jmxremote.password' from template in {{ java_home }}/jre/lib/management/ folder, to use pasword protected JMX ports"
  template:
    src: jmxremote.password.j2
    dest: "{{ java_home }}/jre/lib/management/jmxremote.password"
    mode: 0600

- name: "generate a custom 'jmxremote.access' from template in {{ java_home }}/jre/lib/management/ folder, to use pasword protected JMX ports"
  template:
    src: jmxremote.access.j2
    dest: "{{ java_home }}/jre/lib/management/jmxremote.access"
    mode: 0600


#
# Configure Tomcat
#

- name: generate a custom "setenv.sh" from template, provides the ability to configure Tomcat at start-up from outside the container
  template:
    src: setenv.sh.j2
    dest: "{{ tomcat_catalina_base }}/bin/setenv.sh"
    mode: ug+x

- name: "generate a custom 'jmxremote.password' from template in {{ java_home }}/jre/lib/management/ folder, to use pasword protected JMX ports"
  template:
    src: jmxremote.password.j2
    dest: "{{ java_home }}/jre/lib/management/jmxremote.password"
    owner: "{{ tomcat_root_user }}"
    group: "{{ tomcat_system_group }}"
    mode: 0640

- name: "generate a custom 'jmxremote.access' from template in {{ java_home }}/jre/lib/management/ folder, to use pasword protected JMX ports"
  template:
    src: jmxremote.access.j2
    dest: "{{ java_home }}/jre/lib/management/jmxremote.access"
    owner: "{{ tomcat_root_user }}"
    group: "{{ tomcat_system_group }}"
    mode: 0640

Correct file rights of JMX authentication files
Correct file rights of JMX authentication files
