Skip to content

Commit

Permalink
Fixes #17840: Add a rudder-by-example for git sync in shared-files
Browse files Browse the repository at this point in the history
  • Loading branch information
amousset committed Jun 26, 2020
1 parent 5243825 commit f8844ec
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 1 deletion.
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]

0 comments on commit f8844ec

Please sign in to comment.