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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions ansible/roles/bootstrap/tasks/partials/fedora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,16 @@
when: os not in ("fedora30")
raw: alternatives --install /usr/bin/python python /usr/bin/python2.7 1 && alternatives --set python /usr/bin/python2.7

- name: check for libselinux-python bindings
when: os in ("fedora30")
raw: dnf info libselinux-python | grep Installed
register: has_libselinux
failed_when: has_libselinux.rc > 1

- name: check for python3-libselinux bindings
when: os not in ("fedora30")
raw: dnf info python3-libselinux | grep Installed
- name: check for {{ 'libselinux-python' if os in ("fedora30") else 'python3-libselinux' }} bindings
raw: dnf info {{ 'libselinux-python' if os in ("fedora30") else 'python3-libselinux' }} | grep Installed
register: has_libselinux
failed_when: has_libselinux.rc > 1

- name: install libselinux-python bindings
when: os in ("fedora30") and has_libselinux.rc == 1
raw: dnf install -y libselinux-python

- name: install python3-libselinux nbindings
- name: install python3-libselinux bindings
when: os not in ("fedora30") and has_libselinux.rc == 1
raw: dnf install -y libselinux-python

Expand Down