0

I need to copy files from puppet master to agent using tasks ,whenever I need to copy on random linux servers. Please help me on this.

hardkoded
  • 18,915
  • 3
  • 52
  • 64
  • What did you try? – U. Windl Apr 14 '21 at 15:48
  • More detail around what you’re trying to accomplish would help, but it sounds like using the [upload_file function](https://puppet.com/docs/bolt/latest/plan_functions.html#upload-file) in a plan will do what you want. – steveax Apr 16 '21 at 05:59

1 Answers1

0

A little light on detail, so I have to make some assumptions. You state you use a task, but you mention you want to get rid of corrective changes, which indicates a normal Puppet run, not a task.

My first assumption then is that you are using Puppet code, not executing a task via Bolt or the GUI. Using the file resource, you can state the endpoint for the file in the resource itself: doco

Alternatively, you can use an exec resource with a 'creates' tag to ensure it only pulls it once.

The easiest might be to just use the file resource and place the file in the module.

But, without more info, it will be hard to help properly.

Werner
  • 791
  • 1
  • 6
  • 23