Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #17840: Add a rudder-by-example for git sync in shared-files #754

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/rudder-by-example/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
* Extending Rudder
** xref:extending-rudder/add-new-methods.adoc[Add new methods to the technique editor]
* Configuration policy
** xref:policies/using-secrets-in-configuration-policies.adoc[Using secrets in configuration policies]
** xref:policies/using-secrets-in-configuration-policies.adoc[Use secrets in configuration policies]
** xref:policies/sync-git-repository.adoc[Synchronize files from external git repositories]
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
= Share files from an external git repository

It is a common use case to share files with your nodes from a git repository (containing configuration files,
configuration data, etc.) hosted outside of the Rudder server (Github, Gitlab, etc.).

Rudder allows using its file synchronization mechanism to copy any files,
all we have to do is to setup the git synchronization.

== Prepare the repository

=== Initialize

You need to clone the repository on your Rudder server in
`/var/rudder/configuration-repository/shared-files`.

----

cd /var/rudder/configuration-repository/shared-files
git clone git://my.git.server/conf_files.git

----

=== Update

The simplest way to keep the repository up to date is to use a cron job:

image::git-update.png[Cron task configuration for update]

NOTE: You could also make this cron task capable of running the clone in case the folder is missing
to allow automated installation.

== Synchronize files

You can now use the standard methods for file copy from Rudder server:

* *Files download (Rudder server)* technique
* *File from shared folder* method
* *File from remote source* and *File from remote source recursion* methods

You only need to use the path of you repository (`/var/rudder/configuration-repository/shared-files/conf_files/`) as source, something like:

image::nginx.conf.png[Source file selection for copy]