VMware Cloud Community
miladmeh8
Hot Shot
Hot Shot

Passig variable to saltstack statefile

Hi everyone

I need help in passing variable from cloud assembly to saltstack statefile.

my configuration on my cloud template is :

Cloud_SaltStack_1:
type: Cloud.SaltStack
properties:
hosts:
- ${resource["LinuxVM-Minion"].id}
masterId: saltstack_enterprise_installer
stateFiles:
- /milad/command.sls
saltEnvironment: sse

variables:
- userdbu: miladtest

and for command.sls file :

{% set databaseuser = pillar.get('userdbu', '') %}
test_command:
cmd.run:
- name: touch {{ databaseuser }}.txt
- cwd: /root

 

But at the end i see the file is created like .txt and no parameter is passed to the state file.

I used -template: jinja to render the info but nothing changed

 

Regards,

Milad

 

 

 

Tags (1)
Reply
0 Kudos
0 Replies