Project

General

Profile

Actions

Bug #25868

open

The result of config_group.hosts is always empty

Added by Ondřej Pražák over 5 years ago. Updated over 4 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Puppet integration
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

Description of problem:
Using foreman-rake console or erb code to list all members of a Config Group will always result in an empty host list.
Reason: when we add a host to a Config Group foreman adds the host to the host_config_groups table on postgres with host_type = 'Host::Base'. However, when looking up i.e. when doing myconfgroup.hosts it requires host_type = 'Host::Managed'.

Steps to Reproduce:
1. Create a Config Group
2. Add a Host to the Config Group
3. Optionally, add also a Host Group to the Config Group
4. foreman-rake console
5. ConfigGroup.where(:name => "name of your CG").hosts
6. ConfigGroup.where(:name => "name of your CG").hostgroups


Files

config-group.png View config-group.png 38 KB Ondřej Pražák, 01/16/2019 07:18 AM
Actions #1

Updated by Ondřej Pražák over 5 years ago

  • File config-group.png config-group.png added
  • Subject changed from The result of config_group.hosts is always empty to The result of config_group.hosts is always empty
Actions #2

Updated by Tomer Brisker over 4 years ago

  • Category set to Puppet integration
Actions

Also available in: Atom PDF