Search code examples
filewildcardtransfersalt-project

Saltstack: Transfer multiple files (using wildcard?)


I'm new to Staltstack and I'm starting to do some tests with it, however, I'm facing a small issue and I cant find how to solve it.

I would like to transfer all the files inside a path on the master to a slave, however, I can't get it to work.

Configuration:

/destination_path_on_slave/*:
  file.managed:
    - source: salt://path_on_master/*
    - user: root

However, when trying to apply this, I get the following error:

----------
          ID: /destination_path_on_slave/*
    Function: file.managed
      Result: False
     Comment: Source file salt://path_on_master/* not found
     Changes:
----------

Any clue about how to get this working?

The destination path exists. Thank you.


Solution

  • I think the module you're looking for is file.recurse. It's used to recurse through a set of files whereas file.managed is for a single file.