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
I believe you are looking for something like this:
{
"client" : "local",
"tgt" : "*",
"fun" : "pkg.install",
"arg" : ["nginx"]
}
Reference:
pkg
execution module, which is a virtual module that gets translated into the proper, OS-specific package manager: https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.pkg.html
aptpkg
for debian-based systems using apt
rest_cherrypy
API documentation: https://docs.saltstack.com/en/latest/ref/netapi/all/salt.netapi.rest_cherrypy.html
local
client: https://docs.saltstack.com/en/latest/ref/clients/#salt.client.LocalClientSaltStack 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.