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 ...

Get Salt Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.