I am using CentOS6.5. I can successfully copy a file from master to a minion with id=minionId by running the following command on the master:
salt minionId cp.get_file salt://fileInMaster.txt /home/johnDoe/fileNowInMinion.txt ##run on master
If I have to accomplish the exact same thing using python how do I do it? Following this link all I find is a way to copy a file from master to minion by running a script on the minion. I want to run a python script on master that copies a file from master to a specific minion with given Id
Best Answer
Use the Python client API, or install and run salt-api which exposes a REST API. I'll detail the Python client API: http://salt.readthedocs.org/en/v2014.1.13/ref/clients/index.html
Script totin.py, copies /srv/salt/vim/vimrc.local to tin:/tmp/vimrc.local
Test:
Verify: