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

ansible: fix multiple register vars on Fedora #2654

Merged
merged 1 commit into from
May 24, 2021

Conversation

richardlau
Copy link
Member

Tasks registering variables in Ansible will alway set the variable
regardless of any when clause(s). This means if more than one task
registers the same variable, the last one "wins". Fix the bootstrap
role on Fedora by correctly registering has_libselinux in both
fedora30 and non-fedora30 cases.

Refs: #2531

Fixes this error:

TASK [bootstrap : install libselinux-python bindings] ******************************************************************************************************
fatal: [test-digitalocean-fedora30-x64-2]: FAILED! => {"msg": "The conditional check 'os in (\"fedora30\") and has_libselinux.rc == 1' failed. The error was: error while evaluating conditional (os in (\"fedora30\") and has_libselinux.rc == 1): 'dict object' has no attribute 'rc'\n\nThe error appears to be in '/home/rlau/sandbox/github/build/ansible/roles/bootstrap/tasks/partials/fedora.yml': line 35, 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: install libselinux-python bindings\n  ^ here\n"}

Tasks registering variables in Ansible will alway set the variable
regardless of any `when` clause(s). This means if more than one task
registers the same variable, the last one "wins". Fix the bootstrap
role on Fedora by correctly registering `has_libselinux` in both
`fedora30` and non-`fedora30` cases.
@richardlau richardlau merged commit d15b743 into nodejs:master May 24, 2021
@richardlau richardlau deleted the fedora branch May 24, 2021 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants