-
Notifications
You must be signed in to change notification settings - Fork 229
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
Support multiple envs_dir directories #803
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think keeping the data type of envs_dir
on Stdlib::Absolutepath
is misleading. If it's an array, really make it an array: Variant[Array[Stdlib::Absolutepath, 1], Stdlib::Absolutepath]
.
80f3374
to
380fba5
Compare
380fba5
to
1bf1fd2
Compare
1bf1fd2
to
ca66804
Compare
A wrinkle: this is going to need corresponding changes to the |
ca66804
to
bff3db2
Compare
bff3db2
to
49edf34
Compare
That's why I suggested a Variant. That would accept both a string and an array. |
I didn't mean on the puppet module side, the actual foreman installer which uses this module only knows how to pass a string at the moment. It does not know how to pass an array. The change in behaviour to pass an array of strings instead might be breaking, particularly considering both forwards and backwards compatibility. |
I think it should handle a |
I'm very close to releasing a major version of the module. Would you like to update this so it's an array? I can write the migration on the installer side. |
@ekohl Do you mean switch from |
That is indeed what I mean. I can wait with a major version until Monday. |
49edf34
to
4735dc2
Compare
4735dc2
to
db5a744
Compare
Updated to drop taking a single path as a string (breaking change), and rebased against current master. I've been monkey patching a variant of this change that takes multiple paths as colon-separated strings, since the foreman-installer only passes the arg as a string. I am running foreman nightly, so if you are able to update the installer to pass an array, I'm happy to try testing that against this branch before you roll a release to confirm all working as expected. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very minor thing, other than that 👍
manifests/server/config.pp
Outdated
$puppet::server::envs_dir.each |$dir| { | ||
file { $dir: | ||
ensure => $ensure, | ||
owner => $puppet::server::environments_owner, | ||
group => $puppet::server::environments_group, | ||
mode => $puppet::server::environments_mode, | ||
target => $puppet::server::envs_target, | ||
force => true, | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to modify this since you can pass an array to file
.
I think theforeman/foreman-installer#740 would be the installer migration. |
Will fix in the morning. This is leftover from handling the more complex
variant case. I will revert this hunk and force push.
…On Fri, 4 Feb 2022, 22:34 Ewoud Kohl van Wijngaarden, < ***@***.***> wrote:
***@***.**** requested changes on this pull request.
Very minor thing, other than that 👍
------------------------------
In manifests/server/config.pp
<#803 (comment)>
:
> + $puppet::server::envs_dir.each |$dir| {
+ file { $dir:
+ ensure => $ensure,
+ owner => $puppet::server::environments_owner,
+ group => $puppet::server::environments_group,
+ mode => $puppet::server::environments_mode,
+ target => $puppet::server::envs_target,
+ force => true,
+ }
}
You don't need to modify this since you can pass an array to file.
—
Reply to this email directly, view it on GitHub
<#803 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAH3VL523OXEJPHX56U7ZQTUZRIAZANCNFSM5EM5JPJA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
This module adds support for the puppet environmentpath setting to be configured using multiple directories. An example use-case is where r10k is in use to deploy some but not all environments, to avoid unmanaged environments being purged by r10k. Directories (whether one, or multiple) are passed as an Array of Stdlib::Absolutepath values. This is a breaking change, as a single string will no longer be accepted. - Each listed environmentpath directory will be created and managed by puppet - The default post-receive hook script uses the first listed directory in `envs_dir` to create initial environments to maintain backward compatibility. Tests are included to ensure that all listed directories are created and managed. Fixes theforeman#708
db5a744
to
da97690
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This module adds support for the puppet environmentpath setting to be configured
using multiple directories. An example use-case is where r10k is in use to
deploy some but not all environments, to avoid unmanaged environments being
purged by r10k.
envs_dir
to create initial environments to maintain backward compatibility.envs_dir
, this is only used in the environment.conf.erb template which doesnot appear to be deployed anywhere in the current version of this module
Tests are included to ensure that all listed directories are created and
managed, and that any other references to the envs_dir parameter behave the
same as if only a single directory were specified to maintain backward
compatibility.
Fixes #708