# Install Ansible, required for Packer's ansible-local provisioner
# Git is required by the ansible-galaxy tool when installing roles
-sudo dnf install -y ansible git python-dnf
+# Ansible will fail if selinux is enabled but bindings not installed
+sudo dnf install -y ansible git python-dnf libselinux-python
# Install the latest release of ODL's Ansible role from Ansible Galaxy
# The `ansible-galaxy` tool was installed by Ansible's RPM
src: git+https://git.opendaylight.org/gerrit/p/integration/packaging/ansible-opendaylight.git
version: $ansible_version
EOM
-sudo ansible-galaxy install -r /tmp/requirements.yml
+cat /tmp/requirements.yml
+# Ansible runs as non-root, so don't install as root or role will not be found
+ansible-galaxy install -r /tmp/requirements.yml
# Clean up to save space
# NB: The point of this script is to leave Ansible and ODL's role installed