I. Cp.get_file implementing files from the master side to the Minion server
Cp.get_file
1. Modify/etc/salt/master to specify the root directory of the server's work
File-roots:
-Base:
/srv/salt (default path, can be specified)
2. Create a Directory
Mkdir/srv/salt
3. Copy the files that need to be copied to the working directory
Cp-ra Souce_file/srv/salt
4. Execute cp.get_file command
Salt ' * ' Cp.get_file salt://path/to/file/minion/dest/file
#说明
1) salt://the first '/' root specified for profile base, and the second is a path delimiter
2) Copy to the target must give the file name, can not only give the directory, or error, such as
3) Common options gzip compression (level 1-9), Makedirs=booltype (true| False), whether to create a directory
Salt ' * ' cp.get_file salt://path/to/file/minion/dst/newfile gzip=5 makedirs=true
5. After successful execution, the Minion ID and copy path are returned, as
6. Minion node view corresponding path
Saltstack module Learning to copy the files and directories on the master server to the Minion server