Skip to content

copy

!copy

Category: files

Copy a file (or recursively a directory tree) from the control machine to the target. Idempotent via SHA-512 content comparison.

Parameters

NameTypeRequiredDescription
srcstringyesLocal source path (a directory when recursive: true; otherwise resolved through files/ lookup).
destpathyesRemote destination path.
recursiveboolnoRecursively copy an entire local directory tree to dest.
attributesmapnoFile attributes applied to copied files: owner, group, mode.

Examples

- !copy
  src: app.conf
  dest: /etc/app/app.conf
  attributes:
    mode: '0o600'