I'm fairly new to salt so it's possible that I just missed something, but I can't figure this out.
I am using salt as a command execution tool (no config management so far). I couldn't find a way to fetch configs from minions with salt and put them into git repository.
What I ultimately try to achieve is to give the salt master a list of configfiles like this
/etc/ssh/ssh_config /etc/vim/vimrc etc.
and get salt-master to run fetch these files, put it in folders like
then I could just let the master push whole thing to our git server and have all configs versioned.
I know that salt can handle states but everything I find is about pushing the file from the master to the minion in order to keep the state like it should be, But I just want to collect all the updates configs from all servers and version them automatically.
There is a command called
salt \* cp.push /etc/ssh/ssh_config
that pushes the config file to /var/cache/salt/minion/minion01/files/etc/ssh/ssh_config, which seems perfect, but I don't know how to tell salt to do that whenever a file changes (we have quite a few servers and a lot of configs to version...) and to only fetch it if it has changed so I don't have to fetch all files every five minutes or so (via cron).
Anyone has an idea how to do this with salt?