Skip to content

Review Managing Configurations by using Ansible for CQA#4818

Open
aneta-petrova wants to merge 22 commits intotheforeman:masterfrom
aneta-petrova:cqa-ansible-single-ustory
Open

Review Managing Configurations by using Ansible for CQA#4818
aneta-petrova wants to merge 22 commits intotheforeman:masterfrom
aneta-petrova:cqa-ansible-single-ustory

Conversation

@aneta-petrova
Copy link
Copy Markdown
Member

What changes are you introducing?

Most of the changes revolve around making sure guide is focused on a single high-level user story (configuration management with Ansible) and also its assemblies describe a single user story each.

Other changes include reviewing abstracts, prerequisites, titles to comply with the requirements in https://github.com/theforeman/foreman-documentation/tree/master/.cursor/skills

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

Right now, the Managing Configurations by Ansible mixes two use cases: configuration management (= ensuring hosts maintain a specific state consistently over time) and ad-hoc Ansible tasks (= one-time remote execution). This made it difficult to recognize which tasks are actually useful for the purposes of config management, and which are included just because they also use Ansible or remote execution.

This is why this PR also drops the reused content for remote execution, Ansible collection management, and running Ansible playbooks. Stripping the guide of all non-config management content (and linking to where it's included in other guides) helps the primary purpose of the guide stand out properly.

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

This is part of the downstream Content Quality Assessment (CQA) effort.

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.18/Katello 4.20 (Satellite 6.19)
  • Foreman 3.17/Katello 4.19
  • Foreman 3.16/Katello 4.18 (Satellite 6.18; orcharhino 7.6, 7.7, and 7.8)
  • Foreman 3.15/Katello 4.17
  • Foreman 3.14/Katello 4.16 (Satellite 6.17; orcharhino 7.4; orcharhino 7.5)
  • 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)
  • We do not accept PRs for Foreman older than 3.12.

aneta-petrova and others added 16 commits May 5, 2026 21:25
Move orchestration-related content from the Managing Configurations by
Ansible guide to the Managing Hosts guide. The Ansible guide now focuses
on configuration management (importing and using Ansible roles), while
orchestration tasks (remote execution, running ad-hoc playbooks) remain
in Managing Hosts.

Changes:
- Remove remote execution assemblies from Ansible guide (already in Managing Hosts)
- Move "Running an Ansible Playbook" to Customizing Remote Jobs assembly
- Add conditionals to cross-references so they work in both guides

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Remove procedures for synchronizing and consuming Ansible collections
from the configuration management assembly. These procedures are about
content management and are already documented in the Managing Content
guide under the Managing Ansible Content assembly.

This further focuses the Ansible guide on configuration management
(managing host configurations with Ansible roles) rather than content
management (obtaining Ansible collections).

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add Additional resources sections to Ansible configuration management
modules to link to content that was removed from this guide:

- Link to Ansible collection procedures in Managing Content guide from
  modules about role/collection paths and importing roles
- Link to remote execution assembly in Managing Hosts guide from
  modules about running Ansible roles on hosts and host groups

This ensures users can still find related content even though the guide
is now focused specifically on configuration management.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@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 May 6, 2026
@aneta-petrova aneta-petrova removed the Needs testing Requires functional testing label May 6, 2026
@aneta-petrova aneta-petrova marked this pull request as ready for review May 6, 2026 09:30
Copy link
Copy Markdown
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.

The section Running Ansible roles on hosts feels a bit chaotic to me because it also contains assignment. Should assignment be its own section with an introduction where we give a recommendation on when to assign to a host group and when to assign to a host?

The whole guide IMHO also misses the part that talks about setting up a schedule to keep hosts in line.

What I also miss is that IIRC host roles can also run after a host is provisioned but I forgot the exact details of how that worked.

Zooming out IMHO to a use case: imagine you have a host group with application servers that all need to be configured the same way (for example, they're behind a load balancer). What you should do is assign roles to a host group and ensure they run. When you expand the host group with an additional application server then you want the Ansible roles to run to bring the host in line with the others. If I'm a user, can I figure out how to make my use case work by reading this guide?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In the preview I see this is rendered at https://theforeman-foreman-documentation-preview-pr-4818.surge.sh/nightly/Managing_Configurations_Ansible/index-katello.html#enabling-the-ansible-plugin and then after we also have Configuring your Foreman to run Ansible roles. They have a lot of overlap and I wonder if they should be merged into a single chapter.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I kept these as separate modules on purpose because the fact that the plugin is enabled only on non-Satellite builds makes them trickier to merge into one. Additionally, the procedures are performed in different locations: proc_enabling-the-ansible-plugin.adoc only on the server, proc_configuring-your-project-to-run-ansible-roles.adoc on the server and proxies.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I lean to breaking up chapter 2.2:

  • Step 1 in the procedure (adding roles) is IMHO more step 3.0 (before 3.1. Importing Ansible roles) and something you do repeatedly as you update your roles. Or arguably, it is part of step 3.1 as something that you do before importing. That step already says it is a prerequisite anyway.
  • Step 2 is effectively the installation step for Smart Proxy servers where chapter 2.1 is the installation step on Foreman servers. Perhaps merge those into 1?
  • Step 3 is effectively chapter 4.0: installing the keys is a prerequisite to applying definitions to hosts.


[role="_abstract"]
Use this guide to configure {Project} to use Ansible for remote execution.
Supported Ansible versions follow the Ansible versions provided by the base operating system of {ProjectServer} and {SmartProxies}.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

tech wise, this remains wrong because foreman-packaging packages ansible-core 🙃 but we had this discussion before on line 9.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@ekohl Do you happen to have an opinion (or better yet, advice) on this? If this is wrong, can we update the information to make it right?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Adding to what @maximiliankolb said:

For foreman-deb we still use the OS provided packages. For anything else we started to package ansible-core in Foreman 3.14 and we are responsible for shipping it. IIRC we started to include ansible-core 2.16 because it provides the broadest range of OS support: EL 8 - EL 10.

Can't say for sure what Orcharhino does but I'm guessing they copy what foreman-packaging does.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Would this work to differentiate between foreman-deb and the other flavors?

Comment thread guides/common/modules/con_managing-and-importing-ansible-roles.adoc Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I am a bit unsure about this concept:

  • "managing and importing" -> Could this be split into two?
  • What does managing mean? IMO "managing" is a completely empty term (relates to many many modules, so out of scope)
  • Both line 7 and 8 do not really tell users anything IMO.
  • what does "keeping roles organized" mean? How? Where? Why?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

"Managing roles" is, in my eyes, the step you have to perform after enabling Ansible config management on the server side (assembly_enabling-configuration-management-with-ansible-in-project.adoc) and before actually running the roles on hosts (assembly_running-ansible-roles-on-hosts.adoc). And that's the purpose of the assembly -- to get your roles organized so that you can run them.

I'd rather not split the assembly because then it would be too granular. Grouping the actions in an assembly supports the fact that they are a user story -- there is a larger goal to this than just importing a role, for example.

Comment thread guides/common/modules/con_running-ansible-roles-on-hosts.adoc Outdated
Comment thread guides/common/modules/proc_configuring-your-project-to-run-ansible-roles.adoc Outdated

[role="_abstract"]
Perform the following procedure to enable the Ansible plugin on your {ProjectServer}.
Enable the Ansible plugin on your {ProjectServer} to configure the server for Ansible configuration management.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
Enable the Ansible plugin on your {ProjectServer} to configure the server for Ansible configuration management.
Enable the Ansible plugin on your {ProjectServer} to configure hosts by using Ansible roles through {Project}.

What do you think? My main issue is with "server" which I think we should avoid.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Except that this particular procedure really is performed on the server. The end goal is configuring hosts, sure, but at this point, users are still pretty far from that end goal.

Would this be better, to avoid the generic term "server"?

Suggested change
Enable the Ansible plugin on your {ProjectServer} to configure the server for Ansible configuration management.
Enable the Ansible plugin to configure your {ProjectServer} for Ansible configuration management.

Comment thread guides/common/modules/proc_removing-ansible-roles-from-a-host.adoc Outdated
Comment thread guides/common/modules/proc_running-an-ansible-playbook.adoc
Comment thread guides/common/modules/proc_running-ansible-roles-on-a-host.adoc Outdated
@aneta-petrova
Copy link
Copy Markdown
Member Author

The section Running Ansible roles on hosts feels a bit chaotic to me because it also contains assignment. Should assignment be its own section with an introduction where we give a recommendation on when to assign to a host group and when to assign to a host?

This is intentional. I want each assembly to correspond to a user story, and a user story should help accomplish a meaningful goal. Assigning a role + running it on a host can be that meaningful action performed by a single user. Perhaps it would help if the assembly/chapter wasn't called "running a role" because that duplicates the low-level procedure. "Applying configuration to a host" could work.

Or, if you think that a single user persona is unlikely to assign roles and run then, perhaps I could move the procedures on assigning roles to the preceding assembly that describes managing roles. Do you think this is the caes @ekohl?

The whole guide IMHO also misses the part that talks about setting up a schedule to keep hosts in line.

What I also miss is that IIRC host roles can also run after a host is provisioned but I forgot the exact details of how that worked.

Zooming out IMHO to a use case: imagine you have a host group with application servers that all need to be configured the same way (for example, they're behind a load balancer). What you should do is assign roles to a host group and ensure they run. When you expand the host group with an additional application server then you want the Ansible roles to run to bring the host in line with the others. If I'm a user, can I figure out how to make my use case work by reading this guide?

Great, those are three important gaps. I don't see either of these stories in the current master version of the guide: https://docs.theforeman.org/nightly/Managing_Configurations_Ansible/index-katello.html Do you? If they're there, then I shouldn't have removed them and I can re-add them. If they're not there, then I can file a request to have them documented. What do you think @ekohl?

@aneta-petrova aneta-petrova force-pushed the cqa-ansible-single-ustory branch from 8868662 to 3a3081a Compare May 6, 2026 14:04
aneta-petrova and others added 2 commits May 6, 2026 16:26
Co-authored-by: Maximilian Kolb <mail@maximilian-kolb.de>
@aneta-petrova aneta-petrova force-pushed the cqa-ansible-single-ustory branch from 3a3081a to ca86c6c Compare May 6, 2026 14:27
@aneta-petrova
Copy link
Copy Markdown
Member Author

I believe I've replied to/commented on/pushed back on all of the comments so far. Ready for re-review @ekohl @maximiliankolb

@ekohl
Copy link
Copy Markdown
Member

ekohl commented May 6, 2026

The section Running Ansible roles on hosts feels a bit chaotic to me because it also contains assignment. Should assignment be its own section with an introduction where we give a recommendation on when to assign to a host group and when to assign to a host?

This is intentional. I want each assembly to correspond to a user story, and a user story should help accomplish a meaningful goal. Assigning a role + running it on a host can be that meaningful action performed by a single user. Perhaps it would help if the assembly/chapter wasn't called "running a role" because that duplicates the low-level procedure. "Applying configuration to a host" could work.

Or, if you think that a single user persona is unlikely to assign roles and run then, perhaps I could move the procedures on assigning roles to the preceding assembly that describes managing roles. Do you think this is the caes @ekohl?

IMHO they're separate but related user stories. The first is to make sure you have defined what Ansible needs to run. Part of this is assigning roles to hosts, but also assigning (Ansible) variables and values to a host. That defines what gets run when it is applied.

Once it is configured, you can run Ansible roles. How and when you do that will depend.

Some user stories to think about:

  • I have provisioned or registered a new host and I want to apply the roles. Because the host is part of an already configured host group, the roles are inherited and I don't need to assign any roles.
  • I have multiple hosts behind a load balancer and I need to set up a run where it gets run on at most N hosts at the same time so sufficient hosts remain available behind the load balancer to keep the application running.
  • I have made a change to the assigned roles and/or variables and I want to see what will change so I will run Ansible roles in check mode before actually applying the changes

So I think there is some room to have 1 chapter about configuring and 1 chapter for running. Especially about how and when to do that.

Great, those are three important gaps. I don't see either of these stories in the current master version of the guide: https://docs.theforeman.org/nightly/Managing_Configurations_Ansible/index-katello.html Do you? If they're there, then I shouldn't have removed them and I can re-add them. If they're not there, then I can file a request to have them documented. What do you think @ekohl?

Yes, I think this is the first time I properly read this document and it's very procedure focused and not very use case focused. IMHO that's a gap that should be addressed, though not in this PR.

@aneta-petrova
Copy link
Copy Markdown
Member Author

The section Running Ansible roles on hosts feels a bit chaotic to me because it also contains assignment. Should assignment be its own section with an introduction where we give a recommendation on when to assign to a host group and when to assign to a host?

This is intentional. I want each assembly to correspond to a user story, and a user story should help accomplish a meaningful goal. Assigning a role + running it on a host can be that meaningful action performed by a single user. Perhaps it would help if the assembly/chapter wasn't called "running a role" because that duplicates the low-level procedure. "Applying configuration to a host" could work.
Or, if you think that a single user persona is unlikely to assign roles and run then, perhaps I could move the procedures on assigning roles to the preceding assembly that describes managing roles. Do you think this is the caes @ekohl?

IMHO they're separate but related user stories. The first is to make sure you have defined what Ansible needs to run. Part of this is assigning roles to hosts, but also assigning (Ansible) variables and values to a host. That defines what gets run when it is applied.

Once it is configured, you can run Ansible roles. How and when you do that will depend.

This is great, and I think it ties into what @maximiliankolb was asking in #4818 (comment).

I have updated the list of assemblies to include one for defining Ansible configuration and another one to apply that configuration. As a result, the guide now includes these chapters:

  • Enabling Ansible integration with Foreman (this is the initial step to prepare the environment for Ansible config management)
  • Configuring Ansible definitions to apply to hosts
  • Applying Ansible definitions to hosts

To me, these are logical steps/phases in rolling out Ansible-based configuration management, and hopefully also correspond to user personas.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants