Remove unused views
[releng/builder.git] / jjb / packaging / setup-ansible-rpm.sh
1 #!/bin/bash
2
3 # Options:
4 #   -x: Echo commands
5 #   -e: Fail on errors
6 #   -o pipefail: Fail on errors in scripts this calls, give stacktrace
7 set -ex -o pipefail
8
9 # Install required packages
10 virtualenv rpm_build
11 source rpm_build/bin/activate
12 PYTHON="rpm_build/bin/python"
13 $PYTHON -m pip install --upgrade pip
14
15 # Install Ansible
16 sudo yum install -y ansible
17
18 # Install local version of ansible-opendaylight to path expected by Ansible.
19 # Could almost do this by setting ANSIBLE_ROLES_PATH=$WORKSPACE, but Ansible
20 # expects the dir containing the role to have the name of role. The JJB project
21 # is called "ansible", which causes the cloned repo name to not match the role
22 # name "opendaylight". So we need a cp/mv either way and this is simplest.
23 sudo cp -R $WORKSPACE/packaging-ansible /etc/ansible/roles/opendaylight