the short answer is. you don’t
if it happens in the states the information isn’t available in jinja or in pillar.
if you want to use it in jinja it needs to happen in jinja. in your example
now this can happen on the minion in a state. or it can happen on the master as pillar.{% set aws_secret_sauce = salt["azurem_keyvault_secret.get_secret"](valut_url=xxx, name=xxx, resource_group=xxx, location=xxx, tenant_id=xxx, sku="Standard", connection_auth=authprofile)%}
if you need to happen after the jinja is rendered during the state run for some reason. you can call it with slots. https://docs.saltproject.io/en/3006/topics/slots/index.html but slots are really limited in what they can do or go.
I am trying to use the azurerm_keyvault_secret.get_secret module to pull a secret and use the value within my state.I have the get_secret working, but I am not seeing how to assign the value from the return so that I can use it later in my states.
--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/salt-users/87f42884-daa0-40d2-a48c-ba2e1fe731c0n%40googlegroups.com.
the problem is not the use or not use of value. it is your use of {{}}
{{}}
is shorthand for enter jinja and output result. you don’t need that from within a jinja block.
this is why in my example i did not put the {{}}
you just pass the variable as is.
{% set return = salt['azurerm_keyvault_secret.get_secret'](vault_url="xxxx",name="xxxt",resource_group="xxxxx",location="xxxxx",tenant_id="xxxx",connection_auth=authprofile )[value'] %}
To view this discussion visit https://groups.google.com/d/msgid/salt-users/f02f652b-599e-426b-ab70-b5a3e75829a7n%40googlegroups.com.