About file sync
File sync helps Code Manager keep your Puppet code synchronized across your primary server and compilers.
When a code deployment is triggered, Code Manager uses r10k to fetch code (over HTTPS or SSH) from the Git server and places the code into the staging directory
on the primary server (at /etc/puppetlabs/code-staging
), which is an
internal Git server.
Next, the file sync storage service on the primary server detects the change in the
staging directory, and the file sync clients pause Puppet Server to avoid conflicts during synchronization. Finally, the file sync clients synchronize
the new code to the live code directories on the primary server and compilers (usually
at /etc/puppetlabs/code
).
File sync only deploys Puppet code when an agent is ready to receive the new code. This ensures that your agents' code doesn't change during a Puppet run. File sync triggers an environment cache flush when the deployment is finished, which ensures that new Puppet agent runs use the newly-deployed Puppet code.
File sync is part of Code Manager, and you usually don't need to directly configure or trigger file sync.
Directly accessing the file sync API is unsupported and not recommended.
For information about how code deployments are triggered, refer to How Code Manager works.