jrance
jrance

Reputation: 35

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.

Upvotes: 3

Views: 2909

Answers (1)

Michael Place
Michael Place

Reputation: 3046

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.

Upvotes: 3

Related Questions