Skip to content
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

Refs #29830 - Move discovery plugin docs to RDOC and split out advanced parameters #626

Merged
merged 1 commit into from
Oct 15, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions manifests/plugin/discovery.pp
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# @summary Install the discovery plugin and images on smart proxies
# = Foreman Proxy Discovery plugin
#
# @param install_images
# should the discovery image be downloaded and extracted
# Install the discovery plugin and images on smart proxies
#
# @param tftp_root
# tftp root to install image into
# === Parameters:
#
# @param source_url
# source URL to download from
# $install_images:: Download and extract the discovery image
#
# @param image_name
# tarball with images
# === Advanced parameters:
#
# $tftp_root:: TFTP root directory where extracted discovery image will be installed
#
# $source_url:: source URL to download from
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Outside the scope of this PR, but:

I'd argue that this should in fact refer to the full URL of the file. I don't see the use case for having 2 separate parameters and simply concatenating them. It maybe makes our job a little easier as we refer to the $image_name separately for example at

} ~> exec { "untar ${image_name}":
but it would be better for the user to have $source_url and $image_name combined to a single parameter I think.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I disagree. For example, you mirror it somewhere and only change the base URL while still using the same imagine name as upstream. Another example could be branding where you change the source URL to your company name. It also makes the code a lot harder because now you need to split some URL. That's always painful and a good source of bugs. Given these are advanced parameters, I wouldn't change this.

#
# $image_name:: tarball with images
#
class foreman_proxy::plugin::discovery (
Boolean $install_images = $foreman_proxy::plugin::discovery::params::install_images,
Expand Down