Search code examples
salt-project

Copy local file in Saltstack


I am in a masterless salt-minion, but I would like to manage a file locally. How do I copy a local file around in an Saltstack .sls file?

E.g. something like

/etc/mymodule/proxy.conf:
  file.managed:
    - source: /mymodule.conf

Solution

  • I guess you want to take a look at file.copy instead of file.managed.

    State file.managed uses source key to download content from URI (can be salt://, http://, etc.) - it won't intelligently guess that, if there is no URI scheme in source value, then it should use local path on the minion it runs at.