Hide Forgot
Description of problem: When running a RHV deployment with a non-library environment path selected, the "Satellite" task fails with an error message: Failed to configure host groups: undefined method `puppet_environment' for nil:NilClass /var/log/foreman/production.log shows that the "puppet_environment" method of a nil object was called: 2016-09-13 13:51:57 [foreman-tasks/action] [E] undefined method `puppet_environment' for nil:NilClass (NoMethodError) | /opt/theforeman/tfm/root/usr/share/gems/gems/fusor_server-1.0.14/app/lib/actions/fusor/configure_host_groups.rb:79:in `find_or_ensure_hostgroup' | /opt/theforeman/tfm/root/usr/share/gems/gems/fusor_server-1.0.14/app/lib/actions/fusor/configure_host_groups.rb:44:in `block in run' | /opt/theforeman/tfm/root/usr/share/gems/gems/fusor_server-1.0.14/app/lib/actions/fusor/configure_host_groups.rb:43:in `each' | /opt/theforeman/tfm/root/usr/share/gems/gems/fusor_server-1.0.14/app/lib/actions/fusor/configure_host_groups.rb:43:in `run' | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.11/lib/dynflow/action.rb:506:in `block (3 levels) in execute_run' | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.11/lib/dynflow/middleware/stack.rb:26:in `call' Version-Release number of selected component (if applicable): QCI-1.0-RHEL-7-20160908.1 How reproducible: 100% Steps to Reproduce: 1.) Create a new lifecycle environment, either under Content > Lifecycle Environments or in the deployment wizard for a new RHV deployment. 2.) Start the RHV deployment. 3.) See the above error. Actual results: Failed deployment when selecting lifecycle environment other than the default. Expected results: No failure. Additional info: The relevant code in configure_host_groups.rb is: ---- if lifecycle_environment_id lifecycle_environment = ::Katello::KTEnvironment.find(lifecycle_environment_id) content_view_puppet_environment = content_view.puppet_env(lifecycle_environment) else lifecycle_environment = deployment.organization.library puppet_content_view = find_content_view(organization_id, default_puppet_content_view_name) content_view_puppet_environment = puppet_content_view.puppet_env(lifecycle_environment) end puppet_environment = content_view_puppet_environment.puppet_environment ----
The problem appears to be due to the fact the deployment's content view is published to the Library environment, but not to the selected environment (e.g., Library > Development). The call to content_view.puppet_env(lifecycle_environment) in find_or_ensure_hostgroup therefore fails to find any matching content view versions that match the Development environment, and content_view_puppet_environment.puppet_environment throws NoMethodError.
Resolved by PR 1241 thanks to an effort by fabianvf during the transition from Puppet to Ansible for RHV configuration. Content sync now completes successfully in non-library enironment. https://github.com/fusor/fusor/pull/1241
Should be in ISO: QCI-1.1-RHEL-7-20161007.t.0-QCI-x86_64-dvd1.iso
Verified on QCI-1.1-RHEL-7-20161007.t.0.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHEA-2017:0335