Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow override server.xml.j2 & setenv.sh.j2 template source #55

Open
Akivas opened this issue Nov 8, 2023 · 0 comments
Open

Allow override server.xml.j2 & setenv.sh.j2 template source #55

Akivas opened this issue Nov 8, 2023 · 0 comments

Comments

@Akivas
Copy link

Akivas commented Nov 8, 2023

Proposed feature

Allow the override of server.xml.j2 & setenv.sh.j2 template source in the instance.yml task file

Rationale

This would allow for template override if/when needed, to add or remove functionalities otherwise hardcoded in the template.

Additional context

I had to change the server.xml.j2 template to add new features like services, engines, hosts & aliases declaration but found myself stranded when I had to force the template task to use my own template (even using the same filename in my template folder)

Being able to set a template_src variable per instance would solve this problem :

tomcat_instances:
  - name: "{{ tomcat_name }}"
    server_xml_template_src : server.xml.j2
    setenv_template_src : setenv.sh.j2
    [...]
- name: instance | Configure tomcat instance - server.xml
  ansible.builtin.template:
    src: {{ instance.server_xml_template_src |default('server.xml.j2') }}
    dest: "{{ tomcat_directory }}/{{ instance.name }}/conf/server.xml"
    mode: "0644"
  notify:
    - Restart tomcat instance

This would be the same for the setenv.sh.j2 template.

Thanks o/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant