Questions
Closed this issue · 2 comments
Hello I'm trying to write my own salt formula to deploy crowd and using your repo as an inspiration.
how ever I have few questions I could not google.
For example this:
crowd-server-xsl:
file.managed:
- name: /tmp/crowd-server.xsl
- source: salt://atlassian-crowd/files/server.xsl
- template: jinja
- require:
- file: crowd-install
cmd.run:
- name: 'xsltproc --stringparam pHttpPort "{{ crowd.get('http_port', '') }}" --stringparam pHttpScheme "{{ crowd.get('http_scheme', '') }}" --stringparam pHttpProxyName "{{ crowd.get('http_proxyName', '') }}" --stringparam pHttpProxyPort "{{ crowd.get('http_proxyPort', '') }}" --stringparam pAjpPort "{{ crowd.get('ajp_port', '') }}" -o /tmp/crowd-server.xml /tmp/crowd-server.xsl server.xml'
- cwd: {{ crowd.dirs.install }}/apache-tomcat/conf
- require:
- file: crowd-server-xsl
What is and how does work:
- require:
- file: crowd-server-xsl
Because crowd-server-xsl
is not a real file but state, same with crowd-install
.
Another questions is why is it better to use xsl
instead of templating existing server.xml
?
I'd appreciate you could give me some hints and point to the docs.
Thank you!
Hello!
Regarding the require
: Here's the relevant doc: https://docs.saltstack.com/en/latest/ref/states/requisites.html#requisite-matching
require
is used for state ordering. In this formula we usually use ids instead of file names for matching.
Regarding the xsl transformation:
The formula started out with templating of an existing server.xml. But we found out that the server.xml of Atlassian products sometimes changes between versions. To support different versions with the same formula, the existing server.xml is now modified with xslt transformation instead of being completely overwritten.
If this answers your questions, please close the ticket.
Oh yes thank you!
I missed the ID matching part in documentation.
Thanks for the explanation about xsl.