Skip to content

Conversation

pablomh
Copy link

@pablomh pablomh commented Sep 16, 2025

That way the configuration file won't be deleted when foreman-installer is run again and won't be needed to reload or restart services manually.

What changes are you introducing?

Use custom-hiera.yaml to tune MQTT.

Why are you introducing these changes? (Explanation, links to references, issues, etc.)

Change some manual configuration instructions that would be reverted on the next call to foreman-installer.

Anything else to add? (Considerations, potential downsides, alternative solutions you have explored, etc.)

Contributor checklists

  • I am okay with my commits getting squashed when you merge this PR.
  • I am familiar with the contributing guidelines.

Please cherry-pick my commits into:

  • Foreman 3.16/Katello 4.18 (Satellite 6.18)
  • Foreman 3.15/Katello 4.17
  • Foreman 3.14/Katello 4.16 (Satellite 6.17; orcharhino 7.4)
  • Foreman 3.13/Katello 4.15 (EL9 only)
  • Foreman 3.12/Katello 4.14 (Satellite 6.16; orcharhino 7.2 on EL9 only; orcharhino 7.3)
  • Foreman 3.11/Katello 4.13 (orcharhino 6.11 on EL8 only; orcharhino 7.0 on EL8+EL9; orcharhino 7.1 with Leapp)
  • Foreman 3.10/Katello 4.12
  • Foreman 3.9/Katello 4.11 (Satellite 6.15; orcharhino 6.8/6.9/6.10)
  • We do not accept PRs for Foreman older than 3.9.

Review checklists

Tech review (performed by an Engineer who did not author the PR; can be skipped if tech review is unnecessary):

  • The PR documents a recommended, user-friendly path.
  • The PR removes steps that have been made unnecessary or obsolete.
  • Any steps introduced or updated in the PR have been tested to confirm that they lead to the documented end result.

Style review (by a Technical Writer who did not author the PR):

  • The PR conforms with the team's style guidelines.
  • The PR introduces documentation that describes a user story rather than a product feature.

@github-actions github-actions bot added Needs tech review Requires a review from the technical perspective Needs style review Requires a review from docs style/grammar perspective Needs testing Requires functional testing labels Sep 16, 2025
Copy link

github-actions bot commented Sep 16, 2025

@aneta-petrova
Copy link
Member

I'm not sure about this. A few months ago there was a conversation about how we should steer (Satellite) users away from using hiera (#3752 was the result). That this PR adds a step to edit custom-hiera.yaml seems to go against that.

@pablomh Can you share a bit more context? Is using hiera justified here even for Satellite users?

@pr-processor pr-processor bot added Waiting on contributor Requires an action from the author and removed Not yet reviewed labels Sep 17, 2025
@pablomh
Copy link
Author

pablomh commented Sep 17, 2025

Sure. The current problem is that the systemd configuration file will be wiped the next time foreman-installer is run.

In our performance testing we tend to run foreman-installer several times (one to make the basic installation, other to run additional settings, another to configure MQTT if needed based on the location of the smart-proxy, another to enable IoP, and so on). In our current (as in until one month ago when I changed it to follow this approach), we had to apply the current method (add the file, reload systemd config and restart the service every time) every time we run foreman-installer either in the main Foreman server or the some smart-capsule.

Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

I've always been a bit torn by this. We don't support any content in custom-hiera.yaml and by documenting it we effectively support it. I didn't test it, but I had the impression we didn't manage any drop ins so it wouldn't be pruned. Turns out I was wrong: https://github.com/voxpupuli/puppet-mosquitto/blob/3e88c0a2a447cb5399b4b5a71a864caf7dbff240/manifests/service.pp#L24-L38. So it does make sense in this case.

And then I also had a look at whether that's still needed. eclipse-mosquitto/mosquitto@1f31f14 has recently been merged, but is currently not in any release.

[options="nowrap", subs="+quotes,verbatim,attributes"]
----
# {foreman-installer} --foreman-proxy-plugin-remote-execution-script-mode pull-mqtt
cat >>/etc/foreman-installer/custom-hiera.yaml <<EOF
Copy link
Member

Choose a reason for hiding this comment

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

Typically we don't tell users to run shell commands to add content to files. It's very easy to mess up. In this case they can type cat > /etc/foreman-installer/custom-hiera.yaml and wipe out any contents they had before.

Copy link
Author

Choose a reason for hiding this comment

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

That's why I was careful to write '>>' in case someone copy-pasted it (as I would do). Do you have any recomendation?

Copy link
Member

Choose a reason for hiding this comment

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

Looking at our writers, but I think we typically have some text that comes down to "add the following to /etc/foreman-installer/custom-hiera.yaml".

Another thing to keep in mind: if the user had already added the Hiera key then your command will break. By having a more generic description we put that responsibility on the user.


.Procedure
. Enable pull-based remote execution on your {ProjectServer} or {SmartProxyServer}:
This example configures the `mosquitto` service on a {ProjectServer} or {SmartProxyServer} to handle 5000 content hosts.
Copy link
Member

Choose a reason for hiding this comment

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

We're moving away from content hosts in favor of just hosts

@aneta-petrova
Copy link
Member

Thanks for taking the time to explain @pablomh! Looking at the whole guide, I can see that it references the manual config file a few times already so at the very least, adding one more should be okay. Consider my concern addressed :)

@pablomh
Copy link
Author

pablomh commented Sep 17, 2025

In an ideal world, we'd be OK if this was properly implemented, but I had little time to play with it and had to resort to this approach.

@ekohl
Copy link
Member

ekohl commented Sep 17, 2025

In an ideal world, we'd be OK if this was properly implemented, but I had little time to play with it and had to resort to this approach.

A short term workaround that we deploy by default could be to enhance https://github.com/voxpupuli/puppet-mosquitto to gain a parameter. We can then always set that in our Hiera config. That way we don't need any tuning guide section but it just works out of the box for users. AFAIK increasing the maximum number of open files doesn't have a huge downside.

That way the configuration file won't be deleted when `foreman-installer`
is run again and won't be needed to reload or restart services manually.
@pr-processor pr-processor bot added Needs re-review and removed Waiting on contributor Requires an action from the author labels Sep 17, 2025
@pablomh
Copy link
Author

pablomh commented Sep 17, 2025

I think I've included all the recommended changes (I don't know how to deal with the GitHub reviews, sorry).

Copy link
Contributor

@maximiliankolb maximiliankolb left a comment

Choose a reason for hiding this comment

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

Thanks Pablo. I left three more minor suggestions.

----
# {foreman-installer} --foreman-proxy-plugin-remote-execution-script-mode pull-mqtt
----
This example configures the `mosquitto` service on a {ProjectServer} or {SmartProxyServer} to handle up to 5000 hosts.
Copy link
Contributor

Choose a reason for hiding this comment

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

"{ProjectServer}" can resolve to "orcharhino Server", which would lead to "a orcharhino Server". I have two suggestions: Either ".. on your {SmartProxy}" or "on your {ProjectServer} or {SmartProxyServer}".


.Prerequisites
* You have enabled pull-based remove execution on your {SmartProxy}.
+
Copy link
Contributor

Choose a reason for hiding this comment

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

.Procedure
. On your {SmartProxy}, set the upper limit of connected hosts for pull-based remote execution in `/etc/foreman-installer/custom-hiera.yaml`:
+
[options="nowrap", subs="+quotes,verbatim,attributes"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
[options="nowrap", subs="+quotes,verbatim,attributes"]
[source, yaml, options="nowrap", subs="+quotes,verbatim,attributes"]

@Lennonka Lennonka added the Waiting on contributor Requires an action from the author label Oct 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs style review Requires a review from docs style/grammar perspective Needs tech review Requires a review from the technical perspective Needs testing Requires functional testing Waiting on contributor Requires an action from the author
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants