Select Your Language

Infrastructure and Management

Cloud Computing

Storage

Runtimes

Integration and Automation

  • Comments
  • Sat 6.2 All hosts with my content view as a 'fact'

    Posted on

    Here is a trick you can use on a hostgroup to add a handy paramteter to your systems. I call mine content_view_hosts.

    Hostgroup -> Parameters

    % begin -%>% if @host.content_view.system_names -%>[% @host.content_view.system_names.sort.each do | hostname | -%>'%= hostname %>',% end -%>]% end -%>% rescue => e -%>[]% end -%>
    

    This will set a fact on the host containing all the hosts that share your content view. It updates automatically when a new host checks in using your content view.

    Example use case:
    * All hosts using this content view should have port 12345 open to each other

    by

    points

    Responses

    Red Hat LinkedIn YouTube Facebook X, formerly Twitter

    Quick Links

    Help

    Site Info

    Related Sites

    © 2026 Red Hat