xci: osa: Configure the ARA callback plugin on OPNFV host 67/54267/8
authorMarkos Chandras <mchandras@suse.de>
Wed, 21 Mar 2018 09:07:09 +0000 (09:07 +0000)
committerMarkos Chandras <mchandras@suse.de>
Thu, 22 Mar 2018 16:29:52 +0000 (16:29 +0000)
The OSA deployment is driven by the OPNFV host so we need to install
and configure the ARA plugin there as well.

Change-Id: Ib583f5771a8c2da7531f0a42612d7c0b34fb4898
Signed-off-by: Markos Chandras <mchandras@suse.de>
xci/files/install-lib.sh
xci/installer/osa/playbooks/configure-opnfvhost.yml

index ce52ff4..2679233 100644 (file)
@@ -179,8 +179,13 @@ collect_xci_logs() {
     echo "----------------------------------"
 
     # Create the ARA log directory and store the sqlite source database
-    mkdir -p ${LOG_PATH}/ara/
+    mkdir -p ${LOG_PATH}/ara/ ${LOG_PATH}/opnfv/ara
+
     rsync -q -a "${HOME}/.ara/ansible.sqlite" "${LOG_PATH}/ara/"
+    rsync -q -a root@${OPNFV_HOST_IP}:releng-xci/${LOG_PATH#$XCI_PATH/}/ ${LOG_PATH}/opnfv/ || true
+    rsync -q -a root@${OPNFV_HOST_IP}:.ara/ansible.sqlite ${LOG_PATH}/opnfv/ara/ || true
+
+    sudo -H -E bash -c 'chown ${SUDO_UID}:${SUDO_GID} -R ${LOG_PATH}/'
 }
 
 # vim: set ts=4 sw=4 expandtab:
index 3a904ae..0dc9ec6 100644 (file)
         - pyyaml
         - python-neutronclient
         - python-openstackclient
+    - name: Install ARA callback plugin in OSA virtualenv
+      pip:
+        name: ara
+        state: present
+        extra_args: '-c https://raw.githubusercontent.com/openstack/requirements/{{ requirements_git_install_branch }}/upper-constraints.txt'
+        executable: '/opt/ansible-runtime/bin/pip'
+    - name: Determine ARA callback location
+      shell: "/opt/ansible-runtime/bin/python -c 'import os,ara; print(os.path.dirname(ara.__file__))'"
+      args:
+        executable: /bin/bash
+      register: _ara_install_dir
+    - name: Create local Ansible plugins directory
+      file:
+        path: "{{ ansible_env.HOME }}/.ansible/plugins/callback/ara"
+        state: directory
+    - name: Configure ARA callback
+      file:
+        path: "{{ ansible_env.HOME }}/.ansible/plugins/callback/ara/callbacks"
+        src: "{{ _ara_install_dir.stdout }}/plugins/callbacks"
+        force: yes
+        state: link
     - name: generate password token
       command: "python pw-token-gen.py --file {{openstack_osa_etc_path}}/user_secrets.yml"
       args: