Merge "Update Ansible playbooks to new names"
[releng/builder.git] / jjb / packaging / test-ansible-rpm.sh
index b2c55a43dc06295bcaa593b74ec7c13f78f1c360..d408377c62d35c0b5714ed34bffa893da2581c68 100644 (file)
@@ -11,11 +11,18 @@ virtualenv rpm_build
 source rpm_build/bin/activate
 PYTHON="rpm_build/bin/python"
 $PYTHON -m pip install --upgrade pip
+
+# Install Ansible
 sudo yum install -y ansible
 
-git clone https://github.com/dfarrell07/ansible-opendaylight.git
-cd ansible-opendaylight
-sudo ansible-galaxy install -r requirements.yml
-sudo ansible-playbook -i "localhost," -c local examples/odl_6_testing_playbook.yml
+# Install local version of ansible-opendaylight to path expected by Ansible.
+# Could almost do this by setting ANSIBLE_ROLES_PATH=$WORKSPACE, but Ansible
+# expects the dir containing the role to have the name of role. The JJB project
+# is called "ansible", which causes the cloned repo name to not match the role
+# name "opendaylight". So we need a cp/mv either way and this is simplest.
+sudo cp -R $WORKSPACE/ansible /etc/ansible/roles/opendaylight
+
+# Install OpenDaylight via repo using example Ansible playbook
+sudo ansible-playbook -i "localhost," -c local $WORKSPACE/ansible/examples/rpm_8_devel.yml
 
 # Add more tests