If I run an highstate to my desired minion host following error are
displayed
[root@smartproxy salt]# salt 'vmg-ngx-dev-*' state.highstate
vmg-ngx-dev-001.internal.zone:
Data failed to compile:
···
----------
Rendering SLS "dev:vhosts-sys" failed: Conflicting ID "copyToConfFor"
Normally should there be an “images” and a “videos” String at the End of
the state “copyToConfFor…” like defined in the state id before.
If I render for debug the value of pillar[‘vhost_configs’], it shows the
input of the variable as [‘images’,‘videos’]
How to solve iterating over a list, provided by foreman as parameter?
I can't comment on Salt, but yes, at present global parameters are still
simple strings (Ori, our parameters expert, has a plan for this, but it's
not finished yet). In the meantime, you could try ths workaround (this is
for Puppet which I know best, YMMV with Salt):
Pick a class applied to every host (or every host that you care about for
this global)
Add a smart class variable (not a class parameter, it's the third tab on
the class edit page)
Add your array there, and override as you like
Smart class variable predate class parameters, and are supplied to the ENC
as globals - but are attached to a class. The reasons for this are
historical and complex, but the above workaround will gte you an
array-valued global.
Ok, thanks. I will have a look.
Currently I've done it with jinja.
As parameter value a simple csv List like
vhost_configs=images,videos
and in the salt sls
{% for vhConf in pillar['vhost_configs'].splitt(',') %}
it works for me.
– Tom
···
Am Montag, 13. Juni 2016 23:54:29 UTC+2 schrieb Greg Sutcliffe:
>
> I can't comment on Salt, but yes, at present global parameters are still
> simple strings (Ori, our parameters expert, has a plan for this, but it's
> not finished yet). In the meantime, you could try ths workaround (this is
> for Puppet which I know best, YMMV with Salt):
>
> Pick a class applied to every host (or every host that you care about for
> this global)
> Add a smart class variable (not a class parameter, it's the third tab on
> the class edit page)
> Add your array there, and override as you like
>
> Smart class variable predate class parameters, and are supplied to the ENC
> as globals - but are attached to a class. The reasons for this are
> historical and complex, but the above workaround will gte you an
> array-valued global.
>
> Hope that helps!
> Greg
>