Project

General

Profile

Actions

Bug #28578

closed

Variables can be nil when importing Ansible variables through the Foreman UI

Added by David Ibarra almost 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

Ref: https://community.theforeman.org/t/openscap-plugin-with-ansible-role-variables-import-failed/16601

When attempting ansible variables import through the Foreman UI, there is a case where
clicking Configure > Ansible Variables > Import from Foreman will fail. The error that gets
thrown is the following:

*NoMethodError*
**undefined method `map' for nil:NilClass**

/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_ansible-3.0.9/app/services/foreman_ansible/variables_importer.rb:48:in `initialize_variables'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_ansible-3.0.9/app/services/foreman_ansible/variables_importer.rb:34:in `block in import_variables'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_ansible-3.0.9/app/services/foreman_ansible/variables_importer.rb:31:in `each'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_ansible-3.0.9/app/services/foreman_ansible/variables_importer.rb:31:in `map'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_ansible-3.0.9/app/services/foreman_ansible/variables_importer.rb:31:in `import_variables'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_ansible-3.0.9/app/services/foreman_ansible/variables_importer.rb:25:in `import_variable_names'

I suspect it is the case when you have a mixture of roles that do and do not have default variables set. Need to find a way to make sure the UI ignores those nil variables.

Actions #1

Updated by The Foreman Bot almost 5 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman_ansible/pull/322 added
Actions #2

Updated by Anonymous almost 5 years ago

  • Status changed from Ready For Testing to Closed
Actions #3

Updated by Marek Hulán almost 5 years ago

  • Fixed in Releases foreman_ansible 4.0.4 added
Actions #4

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

  • Bugzilla link set to 1802631
Actions

Also available in: Atom PDF