diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-01 20:15:44 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-01 20:15:44 +0200 |
| commit | 876a5959cedd3699b2c3eccc71ed78badc3bad55 (patch) | |
| tree | 2596099f3061fbabecef5704052db9bda3587ea0 /examples/gem/Rakefile | |
| parent | 84cf996536b62abe91fa881cdf46b72eb44ee24c (diff) | |
add quickstart examples directory and link from README
Diffstat (limited to 'examples/gem/Rakefile')
| -rw-r--r-- | examples/gem/Rakefile | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/examples/gem/Rakefile b/examples/gem/Rakefile new file mode 100644 index 0000000..81a66d4 --- /dev/null +++ b/examples/gem/Rakefile @@ -0,0 +1,27 @@ +# Example: Using RCM as a gem inside a Bundler-managed project. +# +# Run with: +# bundle install +# bundle exec rake setup -- --dry # dry run, no changes made +# bundle exec rake setup -- --debug # verbose output +# bundle exec rake setup # apply configuration +require 'rcm' + +desc 'Apply system configuration' +task :setup do + configure do + # Only run on the host named 'earth' + given { hostname is :earth } + + # Write a WireGuard config rendered from an inline ERB template. + file '/tmp/example/wg0.conf' do + from template + + <<~TEMPLATE + [Interface] + Address = <%= "10.0.0.1/24" %> + ListenPort = 51820 + TEMPLATE + end + end +end |
