4/22/2024 0 Comments List of all minion namesFirst, we need a list of our minion’s IP addresses so that we can use them for targeting. Hmm that was a lot, ok great don't worry we're actually almost finished, we only have a few more targeting methods left. Salt -E '(?!sql)' test.ping Targeting by IP/Subnet This time let’s try targeting every minion except SQL, since we shut it down earlier. Pretty cool right? Well it’s time to step it up a bit! For those of you that enjoy writing regex’s, you can do that too by passing -E*. Let’s go ahead and run a test ping against one of the IIS servers, as well as the MySQL server. List MatchingĪlright, now it’s time to try out List matching, which is exactly like it sounds. Glob Targetingīut what if we a ton of web servers, how on earth are we going to select them all? It’s time to use glob targeting! Go ahead and run:Īwesome job so far! Globbing is simply just a way of using wildcards to match minion names, so in our example, every minion whose ID starts with IIS would be targeted by the iisreset. Suddenly our website isn’t responding and we’re hopeful that restarting IIS will fix it. Great that's perfect, the SQL server has been shut down, pretty easy right? Ok next up, let’s pretend something terrible has happened. Great there we go! But what if we just want to shut down the SQL server? Let’s target the minion by it’s ID. This command gives the status of all of our minions, and while we don’t have a ton of them we do have plenty to explain targeting.įirst, let’s start out by targeting all of our minions using an asterisk. Well that’s what targeting is for! Let’s go ahead and SSH into our salt master and try it out.įirst up, let’s get a list of all of our minions. Welcome back to the DevOps Library, we're glad you found yourself here! Once again this is Samantha and today we’re going to learn about SaltStack targeting.īy now you’ve probably set up several salt minions, and may have even run some commands on them, but what if we want to invoke a command only on a certain group of them?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |