How to copy files from master to agent nodes using tasks

201 views Asked by At

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.

1

There are 1 answers

0
Werner On

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.