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