Bug #36169
openHost group parameters inheriting from root host group rather than parent
Description
Currently experiencing this issue with Foreman 3.5.1 and Katello 4.7.3.
I have a series of nested host groups where differing parameters for lifecycle environments are being set:
| Workstations | - Production | --- Physical | --- Virtual | - Testing | --- Physical | --- Virtual
On the root group, I have it pointing to the Library lifecycle, and the Production/Testing pointing to their associated environments. However, all Physical/Virtual host groups (which I left to inherit) are displaying "Inherit parent (Library)" rather than the correct lifecycle environment of their parent.
This happens in host groups created manually in the UI, via Hammer, and using the theforeman.foreman.host_group Ansible module. My config example:
hostgroups:
- name: "Workstations"
lifecycle_environment: "Library"
content_view: "AlmaLinux 8"
content_source: "{{ inventory_hostname }}"
architecture: "x86_64"
operatingsystem: "AlmaLinux 8"
ptable: "Custom dynamic"
pxe_loader: "Grub2 UEFI HTTP"
root_pass: "{{ root_pass }}"
activation_keys: "al8-library"
- name: "Production"
parent: "Workstations"
lifecycle_environment: "Production"
content_view: "AlmaLinux 8"
content_source: "{{ inventory_hostname }}"
activation_keys: "al8-production"
- name: "Physical"
parent: "Workstations/Production"
subnet: "Physical"
parameters:
- name: "efi_bootentry"
value: "previous"
parameter_type: "string"
- name: "Virtual"
parent: "Workstations/Production"
subnet: "VDI"
compute_resource: "vSphere"
- name: "Testing"
parent: "Workstations"
lifecycle_environment: "Testing"
content_view: "AlmaLinux 8"
content_source: "{{ inventory_hostname }}"
activation_keys: "al8-testing"
- name: "Physical"
parent: "Workstations/Testing"
subnet: "Physical"
parameters:
- name: "efi_bootentry"
value: "previous"
parameter_type: "string"
- name: "Virtual"
parent: "Workstations/Testing"
subnet: "VDI"
compute_resource: "vSphere"
And executed with:
- name: Configure hostgroups
delegate_to: localhost
loop: "{{ hostgroups }}"
no_log: true
theforeman.foreman.hostgroup:
server_url: "https://{{ inventory_hostname }}"
username: "{{ foreman_user }}"
password: "{{ foreman_pass }}"
organization: "myorg"
locations: "{{ hostvars[inventory_hostname].location }}"
domain: "sub.domain.tld"
name: "{{ item.name }}"
lifecycle_environment: "{{ item.lifecycle_environment | default(omit) }}"
content_view: "{{ item.content_view | default(omit) }}"
content_source: "{{ item.content_source | default(omit) }}"
compute_resource: "{{ item.compute_resource | default(omit) }}"
architecture: "{{ item.architecture | default(omit) }}"
operatingsystem: "{{ item.operatingsystem | default(omit) }}"
ptable: "{{ item.ptable | default(omit) }}"
pxe_loader: "{{ item.pxe_loader | default(omit) }}"
root_pass: "{{ item.root_pass | default(omit) }}"
activation_keys: "{{ item.activation_keys | default(omit) }}"
parent: "{{ item.parent | default(omit) }}"
subnet: "{{ item.subnet | default(omit) }}"
parameters: "{{ item.parameters | default(omit) }}"
There looks to be a similar issue rhbz#2002533 - Child hostgroup shows wrong "inherit parent" value in the selection options.
Updated by Mike Rochefort almost 2 years ago
- Subject changed from Baseline host group parameters inheriting from root host group rather than parent to Host group parameters inheriting from root host group rather than parent
Subject adjustment