call variable into another file #67898
Unanswered
vummitimohan
asked this question in
Q&A
Replies: 1 comment
-
See https://docs.saltproject.io/salt/user-guide/en/latest/topics/map-files.html#alternate-map-rendering; the example from that page is |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have two sls files
test01.sls
test02.sls
test01.sls
{% set node_token = [] %}
{% if salt'service.status' %}
{% set token = salt['cmd.run']('/usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s node') %}
{% if token %}
{% do node_token.append(token.strip()) %}
{% endif %}
{% endif %}
test02.sls
{% if grains.host != master_node %}
{% set token = node_token %} =======> node_token I need to call this variable from test01.sls
add_node:
cmd.run:
- name: echo -e 'y' | /usr/share/elasticsearch/bin/elasticsearch-reconfigure-node --enrollment-token {{ token }}
change_config:
cmd.run:
- name: cp /etc/elasticsearch/elasticsearch.yml_new /etc/elasticsearch/elasticsearch.yml
elasticsearch:
service.running:
- enable: True
{% endif %}
anyone help me here
Beta Was this translation helpful? Give feedback.
All reactions