mrjoshuap / ansible-leapp

An Ansible role that attempts an inplace upgrade of EL7 to EL8 using LEAPP
GNU General Public License v2.0
15 stars 12 forks source link

leapp preupgrade report - task always fails with an undefined variable #1

Open dwojewod opened 3 years ago

dwojewod commented 3 years ago

Hi, I tried to use your role for rhel7.7 to 8 upgrade but I am always getting the error. Regardless of how I define leapp_custom_repositories var the following task always fails:

TASK [mrjoshuap.leapp : Generate leapp preupgrade report] *** fatal: [node1.example.com]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: the inline if-expression on line 1 evaluated to false and no else section was defined.\n\nThe error appears to be in '/home/automation/plays4/roles/mrjoshuap.leapp/tasks/preupgrade.yml': line 17, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Generate leapp preupgrade report\n ^ here\n"}

mrjoshuap commented 3 years ago

Are you defining leapp_custom_repositories or just using the default of []?

What versions of Ansible and Python are you using? Can you post the output of:

ansible --version

Thanks!

mrjoshuap commented 3 years ago

I've done a little preliminary testing, and for leapp_custom_repositories using either the default value or a custom repository (epel), I was able to complete the preupgrade:

# Default []
leapp_custom_repositories: []

And after configuring EPEL:

# use custom repo epel:
leapp_custom_repositories:
  - epel

That said, the error mentions an if statement, so I'll do some testing with some values for leapp_skip_rhsm and see if I can reproduce.

dwojewod commented 3 years ago

What versions of Ansible and Python are you using?

Hi,

$ ansible --version ansible 2.9.13 config file = /home/automation/plays4/ansible.cfg configured module search path = ['/home/automation/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3.6/site-packages/ansible executable location = /usr/bin/ansible python version = 3.6.8 (default, Dec 5 2019, 15:45:45) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)]

On the managed node (RHEL 7.7) I had: python-2.7.5-86.el7.x86_64 python2-leapp-0.11.0-1.el7_9.noarch

I added also python3: python3-3.6.8-17.el7.x86_64 python3-libs-3.6.8-17.el7.x86_64

but the playbook execution result is still the same. I used: leapp_custom_repositories: []