set -ex
CICO_USER_DIR=${CICO_USER_DIR:-/root}
WORKSPACE=${WORKSPACE:-/tmp}
ANSIBLE_HOSTS=${ANSIBLE_HOSTS:-$WORKSPACE/hosts}
VENV="${WORKSPACE}/venv"
RDO_CONFIG_DIR="${RDO_CONFIG_DIR:-src/rdo-infra/review.rdoproject.org-config}"

[[ ! -d "${VENV}" ]] && virtualenv "${VENV}"
source "${VENV}/bin/activate"

# Ensure that ansible is installed.
pip install ansible==2.8.0

pushd $WORKSPACE

cat << EOF > delorean-report.yaml
# Create a playbook to report results to delorean
- name: Report results to delorean
  hosts: openstack_nodes
  gather_facts: no
  tasks:
   - shell: |
        export WORKSPACE=${CICO_USER_DIR}/workspace
        export TOCI_JOBTYPE="${JOB_NAME}"
        export LOG_HOST_URL="https://centos.logs.rdoproject.org/"
        export LOG_PATH="${JOB_NAME}/${BUILD_NUMBER}/logs"
        export SUCCESS=${SUCCESS}
        bash -ex ${CICO_USER_DIR}/${RDO_CONFIG_DIR}/ci-scripts/tripleo-upstream/dlrnapi_report.sh
EOF

# Run the playbook.
ansible-playbook -vvv -i "${ANSIBLE_HOSTS}" delorean-report.yaml

popd

set -ex
CICO_USER_DIR=${CICO_USER_DIR:-/root}
WORKSPACE=${WORKSPACE:-/tmp}
ANSIBLE_HOSTS=${ANSIBLE_HOSTS:-$WORKSPACE/hosts}
VENV="${WORKSPACE}/venv"
RDO_CONFIG_DIR="${RDO_CONFIG_DIR:-src/rdo-infra/review.rdoproject.org-config}"

[[ ! -d "${VENV}" ]] && virtualenv "${VENV}"
source "${VENV}/bin/activate"

# Ensure that ansible is installed.
pip install ansible==2.8.0

pushd $WORKSPACE

cat << EOF > delorean-report.yaml
# Create a playbook to report results to delorean
- name: Report results to delorean
  hosts: openstack_nodes
  gather_facts: no
  tasks:
   - shell: |
        export WORKSPACE=${CICO_USER_DIR}/workspace
        export TOCI_JOBTYPE="${JOB_NAME}"
        export LOG_HOST_URL="https://centos.logs.rdoproject.org/"
        export LOG_PATH="${JOB_NAME}/${BUILD_NUMBER}/logs"
        export SUCCESS=${SUCCESS}
        export PATH=$PATH:/root/.local/bin

        bash -ex ${CICO_USER_DIR}/${RDO_CONFIG_DIR}/ci-scripts/tripleo-upstream/dlrnapi_report.sh
EOF

# Run the playbook.
ansible-playbook -vvv -i "${ANSIBLE_HOSTS}" delorean-report.yaml

popd

Append .local/bin to path before running dlrn-report
ppc64le: Append .local/bin to path before running dlrn-report

We're currently getting complaints from pip that dlrnapi-client
has installed to /root/.local/bin but that the directory is not
part of the PATH. This patch appends it to the path.

Co-Authored-By: Adam C Kimball <402e0e338e068ec37b4a72d7566ca395e248bcd9@astyr.net>
Change-Id: I8199934eb848a8098b02118f4359732efd616185
