diff --git a/ansible/roles/bootstrap/tasks/partials/fedora.yml b/ansible/roles/bootstrap/tasks/partials/fedora.yml index fdc8173a9..5e08221dc 100644 --- a/ansible/roles/bootstrap/tasks/partials/fedora.yml +++ b/ansible/roles/bootstrap/tasks/partials/fedora.yml @@ -20,15 +20,8 @@ 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 @@ -36,7 +29,7 @@ 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