Comments (6)
In my opinion, switching to a webhook based workflow instead of a regular cronjob is a better solution for what you're looking for. Having r10k only run when there are changes to the control repo means that every time r10k runs there is something that did change. You can then use the $modifiedenvs
value passed to the postrun script for the script to know which environments need to be reloaded, and only reload those environments.
from r10k.
I agree that webhooks is 100% the way to go however there are lots of ocasions where I have a module change that is defined in my control repo as 'main' that needs to trigger a pull on r10k but that doesn't always trigger a change to the control repo... Is there a list of environment variables documented somewhere that are passed to the postrun script? (I'm going to grep the source now that you have provided me with one)
from r10k.
Nothing is passed into the script by default, so you have to explicitly define it as an argument in the config file.
postrun: ['/usr/local/bin/r10k-postrun', '$modifiedenvs']
The only reference to it I've found in the docs has been here: https://github.com/puppetlabs/r10k/blob/28232fa24f04925af666f3dc603df5bcbfdb2bc7/doc/dynamic-environments/configuration.mkd
from r10k.
I agree that webhooks is 100% the way to go however there are lots of ocasions where I have a module change that is defined in my control repo as 'main' that needs to trigger a pull on r10k but that doesn't always trigger a change to the control repo...
In this case, you could still use a webhook that triggers a different command to run, e.g.
r10k deploy module main
This causes all environments that have the module main
to pull in the change. I believe you can then additionally use the $modifiedenvs
variable with a postrun script to trigger reloads, etc.
from r10k.
Yes, we use the webhook functionality provided by the voxpupili r10k puppet module, which has two endpoints: one for control-repositories which will deploy environments, and one for modules which will deploy the module.
https://github.com/voxpupuli/puppet-r10k/blob/master/templates/webhook.bin.erb
from r10k.
Closing, as the webhook functionality appears to be a better approach.
from r10k.
Related Issues (20)
- Require docker image for ARM64 platform HOT 3
- rugged segmentation fault HOT 2
- environment_name is undocumented HOT 5
- Setting install_path on a module in an environment source errors
- Tarball module content will be unpacked into an subdirectory with tarball name HOT 2
- R10k canβt be installed with Ruby 3.x HOT 6
- Add a TOC to the configuration doc
- svn doesn't work any more HOT 5
- Yaml environments fails to deploy banch when commit sha is a number HOT 1
- r10k gem fails to install on windows without admin or Create symbolic links user rights HOT 2
- R10k should be able to use bare Git repository without authentication as conrol_repo HOT 4
- R10k container - cannot generate types (missing puppet binary) HOT 1
- $modifiedenvs does not pass environment to postrun hook on deletion HOT 1
- r10k should not depend on gettext as a runtime dependency HOT 1
- r10k puppetfile install fails with "ERROR -> wrong number of arguments (given 2, expected 1)" when pool_size set to 1 HOT 1
- Not sure about the hiera.yaml statement in common-patterns HOT 2
- Allow override of exclude_spec option with puppetfile install subcommand HOT 1
- r10k gem is not compatible with faraday 2.9.0 HOT 2
- environment deployments: postrun $modifiedenvs lists all environments rather than only those modified HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from r10k.