6 # -o pipefail: Fail on errors in scripts this calls, give stacktrace
9 # Install required packages
11 source rpm_build/bin/activate
12 rpm_build/bin/python -m pip install --upgrade pip
15 sudo yum install -y ansible
17 # Install local version of ansible-opendaylight to path expected by Ansible.
18 # Could almost do this by setting ANSIBLE_ROLES_PATH=$WORKSPACE, but Ansible
19 # expects the dir containing the role to have the name of role. The JJB project
20 # is called "ansible", which causes the cloned repo name to not match the role
21 # name "opendaylight". So we need a cp/mv either way and this is simplest.
22 sudo cp -R $WORKSPACE/ansible /etc/ansible/roles/opendaylight
24 # Install OpenDaylight via repo using example Ansible playbook
25 sudo ansible-playbook -i "localhost," -c local $WORKSPACE/ansible/examples/rpm_8_devel.yml
27 # Create Ansible custom module directories
28 sudo mkdir -p /usr/share/ansible/plugins/modules
30 # Copy the custom module to the directory above
31 sudo cp $WORKSPACE/ansible/library/odl_usermod.py /usr/share/ansible/plugins/modules/
33 # Execute the tests playnook
34 sudo ansible-playbook -i "localhost," -c local $WORKSPACE/ansible/tests/test-odl-users.yaml -vvv