0

I have a slight confusion in relation to passing pillar across state files.

I am using an Orchestrator to orchestrate running states on two vms (example vm1 and vm2). These states have no dependency on each other

To each vm, I pass a pillar with the same key but different value

My limited knowledge of Salt tells me that since the states don't have any dependency the orchestrator can execute them in parallel.

If that is indeed the case, what happens to the pillar value.

Do both the vms' see the same value of the pillar?

Essentially, my questions is when pillars are passed to states files on different minions, do the pillars with the same key merge (and last one wins) or are the pillars localized to their targets

2

Information transferred via pillar is guaranteed to only be presented to the minions that are targeted.

So if your /srv/pillar/top.sls looks something similar to this:

base:
  'vm1':
     - vm1_data
  'vm2':
     - vm2_data

And the pillar: /srv/pillar/vm1_data.sls:

info: some data for vm1

And /srv/pillar/vm2_data.sls:

info: some data for vm2

Then there is no possibility that vm1 will receive the pillar for vm2. Unless the same pillar is targeted for both minions!

See the minions pillar data

After updating your pillar, ensure the minions get the updated data:

salt '*' saltutil.refresh_pillar

Now the minions have the pillar data, it can be retrieved:

salt '*' pillar.items

See the Pillar Walkthrough for more examples and usage information.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.