Repository navigation
Conversation
a1a56d2 to
c1e34a2
Compare
c1e34a2 to
5326776
Compare
| @@ -0,0 +1,320 @@ | |||
| --- | |||
| layout: default | |||
| title: "Deploying Code with r10k" | |||
There was a problem hiding this comment.
In a future PR, would you be interested in documenting codavox here as well? (maybe "Deploying Code with r10k" is a too specific title). We could also mention g10k in another PR here.
There was a problem hiding this comment.
Happy to, been meaning to get around to writing a codavox blog post
| ## Give r10k access to your repository | ||
|
|
||
| r10k shells out to `git`, so it uses whatever SSH configuration the user running it has. | ||
| The webhook service and cron both run r10k as `root`, so create a key for `root` and register its public half as a read-only deploy key on the control repository. |
There was a problem hiding this comment.
IMHO we should change this in the future and run it as puppet. Puppet Enterprise also does it as pe-puppet user. I've this in my provisioning:
# figure out if we're on PE or OpenSource
user=$(id pe-puppet &>/dev/null && echo pe-puppet || echo puppet)
systemd-run --uid="$user" --gid="$user" --wait /usr/local/bin/r10k deploy environment production --modules --incremental --exclude-spec --verbose
There was a problem hiding this comment.
https://github.com/voxpupuli/puppet-r10k/blob/master/manifests/webhook.pp#L21 I have service_user => 'puppet', in my puppet code.
| A cron entry that deploys every fifteen minutes is enough for many sites: | ||
|
|
||
| ```text | ||
| */15 * * * * root /opt/puppetlabs/puppet/bin/r10k deploy environment --modules |
There was a problem hiding this comment.
Could you instead recommend a systemd timer?
|
|
||
| ```console | ||
| sudo ssh-keygen -t ed25519 -N '' -C "r10k@$(hostname -f)" \ | ||
| -f /root/.ssh/id_ed25519 |
b57ee2e to
8b40f68
Compare
| All commands on this page run on the OpenVox server node. | ||
|
|
||
| The `puppet-r10k` release used here declares support for OpenVox 8 only. | ||
| On an OpenVox 9 server, check the [module's dependencies](https://forge.puppet.com/modules/puppet/r10k/dependencies) for a release that lists OpenVox 9 before relying on it. |
There was a problem hiding this comment.
I released a new version of the module. It now lists OpenVox 9.
Covers installing r10k with the puppet-r10k module, giving it a read-only deploy key, the first deploy by hand, cron and webhook-go for automatic deploys, and the GitHub and GitLab hook setup, including the GitLab outbound-requests setting that rejects webhooks on private addresses with "Invalid url given". Every command was run as written on the Hetzner lab against GitLab 19.4.1 (self-managed), gitlab.com and GitHub. Findings folded in: r10k deploys a dashed branch under its corrected name, GitLab caches the outbound-requests setting for about a minute, the module links /usr/bin/r10k, vcsrepo is pinned to the version the Forge resolver picks, and the form labels match GitHub's live settings pages and GitLab's form sources. Closes OpenVoxProject#509 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Michael Harp <mike@mikeharp.com>
…nt cache Addresses bastelfreak's review: r10k, the timer and webhook-go all run as the puppet user (deploy key in its data directory, cachedir under the server vardir, service_user on r10k::webhook), the cron example becomes a systemd service and timer, and a new section covers flushing the environment cache from r10k's postrun when environment_timeout is unlimited. On OpenVox Server 8 that needs the auth.conf rule that 9.x ships; both the 403 and the 204 after adding it were verified on the lab, as were the puppet-user deploys by hand, by timer and by webhook. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Michael Harp <mike@mikeharp.com>
…ed yet openvox-server #640 was labelled backport 8.x and #645 merged it into the 8.x branch on 2026-09-17; no 8.x release has shipped since 8.16.0, so the page says 8.16.0 and earlier need the rule added by hand. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Michael Harp <mike@mikeharp.com>
puppet-r10k 15.3.0 (2026-10-08) widens the openvox requirement to >= 8.19.0 < 10.0.0, so the tip warning OpenVox 9 users off the module is no longer needed. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Michael Harp <mike@mikeharp.com>
8e16f6e to
36f2f65
Compare
Adds a getting-started page, Deploying Code with r10k, between "Setting up a Server" and "Architecture and Concepts" in the ecosystem collection, plus a nav entry and cross-links from the two neighbouring pages.
The trail ended with a control repository and no documented way to get it onto the server. The page covers:
puppet/r10kmodule (scratch modulepath andpuppet applyfor the first run, the control repository afterwards)root, and the firstr10k deploy environment --modulesr10k::webhookclass422 Invalid url given) and the admin setting that allows themabrader-gmsgit_webhookpath, and a short troubleshooting listVerification
Every command on the page was run as written on a Hetzner lab (OpenVox 8 server on AlmaLinux 10, agents on AlmaLinux 9 and Ubuntu 24.04) against a self-managed GitLab 19.4.1, gitlab.com, and GitHub:
r10k.yaml, and the gem landing in the agent's Ruby, on the master and on a node with no r10k at allr10k::webhookwith the queue enabledfeature-xdeploys asfeature_x, which the page now describesTwo findings from the lab went into the page: GitLab caches the outbound-requests setting for about a minute, so pushes right after the change still fail and need resending, and the module links
/usr/bin/r10k.The web-form labels were checked too: GitHub's against the live Settings pages, GitLab's against the form sources in gitlabhq (
shared/deploy_keys/_form,admin/application_settings/_outbound, and thewebhooks/componentsVue files).Review changes (second commit)
Following the review: r10k, the systemd timer and webhook-go all run as the
puppetuser (deploy key in its data directory,cachedirunder the server vardir,service_useronr10k::webhook); the cron example is now a systemd service and timer; and a new section covers flushing the environment cache from r10k'spostrunwhenenvironment_timeoutisunlimited. OpenVox Server 9 ships theauth.confrule that allows the flush, and it is backported to the 8.x branch (openvox-server #645) but not in a release yet, so for 8.16.0 and earlier the page shows the rule to add; the stock configuration answers 403. All of it was re-run on the lab from a snapshot: deploys aspuppetby hand, by timer and by webhook, the 403 on 8.15.2, and the 204 after adding the rule.Closes #509
Assisted by Claude.