Skip to content

Instantly share code, notes, and snippets.

@varunpalekar
Created May 23, 2017 05:55
Show Gist options
  • Save varunpalekar/e9c02af7993c212ccb2b4acadbd20183 to your computer and use it in GitHub Desktop.
Save varunpalekar/e9c02af7993c212ccb2b4acadbd20183 to your computer and use it in GitHub Desktop.

Run normal shell command on:

salt '*' cmd.run 'hostname'

In above cmd => function and run => module function of main function, you can also write your own function and many people already made many of them, you can also use them.

salt '*' disk.usage

Above function is for disk usage

salt '*' pkg.install cowsay

Above function is for package install

salt '*' network.interfaces

Top run and define task

Now you can define run task in single file top.sls

base:
  '*':
    - common
  'minion1':
    - nettools
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment