Search code examples
salt-project

Simplistic example for installing a software using master REST API for SaltStack


I am new to salt stack and trying my hands with it. I am trying to install a simplistic app say nginx on my minions using rest api.

I am able to ping my minions using following API call.

POST on https://x.x.x.x:8080 using following payload:

{
    "client" : "local",
    "tgt" : "*", 
    "fun" : "test.ping" 
}

On the similar line, I am looking for how to install a software on all of my minions. I couldn't find clear step in the documentation I looked at. Could someone help with this please ?

Thanks


Solution

  • I believe you are looking for something like this:

    {
        "client" : "local",
        "tgt" : "*", 
        "fun" : "pkg.install",
        "arg" : ["nginx"]
    }
    

    Reference:

    SaltStack also has an open source CLI tool for targeting the Salt API, called pepper, that you may find useful:

    Also, here are some great resources to those new to SaltStack that may also be helpful for others. They are great places to ask questions, learn new content, hear directly from maintainers and other users, etc.