Last active
January 11, 2020 22:54
-
-
Save bemeyert/738b86f87ad844d1a352 to your computer and use it in GitHub Desktop.
Saltstack - map.jinja usage fails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{#- 'version' comes only from pillars | |
'application_dir' - Atlassian puts the string "-standalone" at the end of the extracted application | |
#} | |
{%- set jira = | |
{ | |
'install_dir' : '/opt/jira', | |
'user' : 'jira', | |
'group' : 'jira', | |
'home' : '/data/jira', | |
'version' : '', | |
'port' : '8080', | |
} | |
%} | |
{#- update/overwrite 'jira' with pillars #} | |
{%- do jira.update( salt.pillar.get('jira') ) %} | |
{#- Now that all data are collected we can assemble application_dir #} | |
{%- do jira.update( | |
{ | |
'application_dir': jira.install_dir + '/atlassian-jira-' + jira.version + '-standalone' | |
} | |
) %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{%- from 'global/jira/map.jinja' import jira with context %} | |
[...] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{#- 'version' comes only from pillars | |
'application_dir' - Atlassian puts the string "-standalone" at the end of the extracted application | |
#} | |
{%- set jira = | |
{ | |
'install_dir' : '/opt/jira', | |
'user' : 'jira', | |
'group' : 'jira', | |
'home' : '/data/jira', | |
'version' : '', | |
'port' : '8080', | |
'application_dir': install_dir + '/atlassian-jira-' + version + '-standalone' | |
} | |
%} | |
{%- do jira.update( salt.pillar.get('jira') ) %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[root@salttestvm70 ~]# salt-call state.sls global.jira | |
[CRITICAL] Rendering SLS 'base:global.jira' failed: Jinja variable 'install_dir' is undefined | |
/var/cache/salt/minion/files/base/global/jira/map.jinja(4): | |
--- | |
{#- 'version' comes only from pillars | |
'application_dir' - Atlassian puts the string "-standalone" at the end of the extracted application | |
#} | |
{%- set jira = <====================== | |
{ | |
'install_dir' : '/opt/jira', | |
'user' : 'jira', | |
'group' : 'jira', | |
'home' : '/data/jira', | |
[...] | |
--- | |
local: | |
Data failed to compile: | |
---------- | |
Rendering SLS 'base:global.jira' failed: Jinja variable 'install_dir' is undefined | |
/var/cache/salt/minion/files/base/global/jira/map.jinja(4): | |
--- | |
{#- 'version' comes only from pillars | |
'application_dir' - Atlassian puts the string "-standalone" at the end of the extracted application | |
#} | |
{%- set jira = <====================== | |
{ | |
'install_dir' : '/opt/jira', | |
'user' : 'jira', | |
'group' : 'jira', | |
'home' : '/data/jira', | |
[...] | |
--- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment