Update example builds in pkg unit tests
[integration/packaging.git] / packer / provision / config_ansible_fedora.sh
index c8c5ab4ae341486cbed9bd8ae3bf646cb8280705..fccd7df636e8f40cb6d5bb83d5a139b5e117bf49 100644 (file)
@@ -7,7 +7,8 @@ set -x
 
 # 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
@@ -33,7 +34,9 @@ cat > /tmp/requirements.yml << EOM
   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