Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dwojewod opened this issue Oct 29, 2020 · 3 comments
Open
Assignees

Comments

@dwojewod
Copy link

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
Copy link
Owner

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
Copy link
Owner

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.

@mrjoshuap mrjoshuap self-assigned this Oct 29, 2020
@dwojewod
Copy link
Author

dwojewod commented Nov 2, 2020

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: []

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants