O'Reilly logo

Salt Cookbook by Anirban Saha

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using execution modules

Modules are the basic foundations of configuration management in Salt. Using Salt modules, we can configure systems from Salt state files, as well as from the command line. In this chapter, you will learn about how to use Salt modules from the command line.

How to do it...

Configure a minion in the staging environment. We will call it stgdc1log01.

  1. Run the following command to list all the cron entries for the root user on the minion:
    [root@salt-master  ~]# salt 'stgdc1log01' cron.list_tab root
    stgdc1log01:
        ----------
        crons:
        env:
        pre:
        special:
    
  2. Run the following command to add a new cron entry for the root user:
    [root@salt-master ~]# salt 'stgdc1log01' cron.set_job root '00' '12' '*' \ '*' '*' 'find /var/log/ -mtime +30 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required