Saltstack (iii) remote execution

Source: Internet
Author: User

First, simple test

In the previous 3 subsections we introduced Saltstack and explained the installation deployment of salt. Believe that you now have only one master and at least one minion. Can we do something about it? The following two chapters lead readers to quickly use Saltstack's remote execution and configuration management functions.

One of the core functions of saltstack at remote execution time. The main use of the Salt module can be batch to the selected Minion side to execute the corresponding command, and get the results returned. Let's execute the first salt command.

[[Email protected] ~] # Salt ' * ' test.pingsalt-client:    True

The above command is used to see which Minion nodes are connected to master. * refers to the selected target Minion, which is clearly representative of all. Is all the Minion end. Test.ping is a module that salt remotely executes. (Note: This is not an ICMP ping.) )

Saltstack can use the Cmd.run module to execute shell commands remotely, using Cmd.run. For example, let the Minion node run the date command.

[[Email protected] ~] # Salt ' * ' cmd.run ' date '        salt-client:            04:45:46 CST 2016

Saltstack provides a large number of command modules that can be used. For more detailed remote implementation of the relevant knowledge, please refer to Chapter Nineth. Well, maybe you don't want to have more orders, so enjoy your cmd.run. However, because Cmd.run can execute all the commands, it is not recommended to use Cmd.run in a production environment. Or use ACLs to control which users are allowed to use Cmd.run.

Saltstack (iii) remote execution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.