Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 424
jrance Avatar asked Nov 22 '25 10:11

jrance


1 Answers

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.

like image 101
Michael Place Avatar answered Nov 25 '25 03:11

Michael Place



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!