Saltstack file issued and pulled

Source: Internet
Author: User
Tags saltstack

Saltstack file issued and pulled


Salt file issued, using the Cp.get_file function, empty file is not in effect

[email protected] base]# salt  ' * '  cmd.run  ' ls /root/' hadm.com:     anaconda-ks.cfg    install.log     install.log.sysloghad6.com:    abc    anaconda-ks.cfg     dump.rdb    install.log    install.log.syslog     put1    puth1    test    test1had5.com :    abc    anaconda-ks.cfg    install.log     install.log.syslog    put1    test     test1[[email protected] base]# salt  ' * '  cp.get_file salt://files/test1   /root/test_00hadm.com:    /root/test_00had6.com:    /root/ test_00had5.com:    /root/test_00[[email protected] base]# salt  ' * '  cmd.run  ' ls /root/' hadm.com:     anaconda-ks.cfg    install.log    install.log.syslog     test_00had5.com:    abc    anaconda-ks.cfg     install.log    install.log.syslog    put1     test    test1    test_00had6.com:     abc    anaconda-ks.cfg    dump.rdb     Install.log    install.log.syslog    put1    puth1     test    test1    test_00


Salt file pull using Cp.push, you need to add the following configuration in the master configuration file and restart Master:

Fileserver_backend:

-Roots

-Minion


File_recv:true


Example:

[[email protected] minions]# Salt ' had5.com ' cp.push/root/put1had5.com:true[[email protected] minions]# Salt ' hadm.c    Om ' cp.list_master_dirshadm.com:-. -_returners-files-had5.com/root-mysqlbackup--file PUT1 has been pulled to/var/cache/salt/master/minions/minion_id/files directory [[ Email protected] minions]# LL/VAR/CACHE/SALT/MASTER/MINIONS/HAD5.COM/FILES/ROOT/PUT1--we can also use Salt://minion_id/ To access the files pulled over. [[email protected] minions]# Salt ' had6.com ' cp.get_file salt://had5.com/root/put1/root/put1had6.com:/root/put1[[ema Il protected] minions]# salt ' had6.com ' cmd.run ' ls/root/put1 ' had6.com:/root/put1


This article is from the "Days together with it" blog, so be sure to keep this source http://raugher.blog.51cto.com/3472678/1687970

Saltstack file issued and pulled

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.