Search code examples
pythonapisalt-project

Getting and setting pillar values with saltstack python api


I am writing some code that integrates with saltstack. I have been able to get the pillar values into a dictionary by using the following:

import salt.client
caller = salt.client.Caller()
data = caller.function('pillar.items')

However, I have had a hard time finding a way to set the data once I change it in python.

Do you know of a way to set specific pillar values via the saltstack python api?


Solution

  • Thank you both donkopotamus and mafrosis. You both added valuable information.

    In this case, in order to modify the pillar variables, I will have to modify the variables in the static salt script files. Then I will be able to use them on the salt minions.