Book Image

Salt Cookbook

By : Anirban Saha
Book Image

Salt Cookbook

By: Anirban Saha

Overview of this book

Table of Contents (18 chapters)
Salt Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Using Salt runners


We have been learning about how to perform all sorts of functions on the minion. However, there are methods to run utility functions on the Salt master itself, to perform various tasks such as looking up the job history, finding out minion details, and so on. In this recipe, we will look at how we can do these tasks using Salt runners.

How to do it...

  1. Configure two minions in the staging environment called stgdc1log01 and stgdc1app01. Start the minions, let them authenticate with the Salt master, and then shut down the minion service daemon on stgdc1app01.

  2. Run the following command to see the overall minion data:

    [root@salt-master  ~]# salt-run manage.status
    down:
        - stgdc1app01
    up:
        - stgdc1log01
    
  3. Run the following command to get a grain detail from one of the minions:

    [root@salt-master  ~]# salt -vv 'stgdc1log01' grains.item server_type
    Executing job with jid 20141123180047497261
    -------------------------------------------
    
    stgdc1log01:
        ----------
        server_type...