64b788e0dea5e7bc5e67f68032c345b8fc898b30
[releng/builder.git] / jjb / packaging / test-ansible-deb-custom-config.sh
1 #!/bin/bash
2
3 # Uninstall any previous installation
4 sudo apt-get remove opendaylight && sudo apt-get purge opendaylight
5
6 # Delete the ODL directory to ensure a clean working enviroment
7 sudo rm -rf /opt/opendaylight
8
9 # Install OpenDaylight via repo using example Ansible playbook
10 sudo ansible-playbook -i "localhost," -c local $WORKSPACE/packaging-ansible/examples/deb_repo_api.yml --extra-vars "@$WORKSPACE/packaging-ansible/examples/log_vars.json"
11
12 # Create Ansible custom module directories
13 sudo mkdir -p /usr/share/ansible/plugins/modules
14
15 # Copy the custom module to the directory above
16 sudo cp $WORKSPACE/packaging-ansible/library/odl_usermod.py /usr/share/ansible/plugins/modules/
17
18 # Execute the odl-user-test playbook
19 sudo ansible-playbook -i "localhost," -c local $WORKSPACE/packaging-ansible/tests/test-odl-users.yaml -v
20
21 # Test the custom log configurations
22 sudo ansible-playbook -i "localhost," -c local $WORKSPACE/packaging-ansible/tests/test-odl-logs.yaml -e test_log_level=DEBUG -e test_log_mechanism=console -v