From e13815c7b03dc3ca3ef8ff54d4d86ec79ece14ed Mon Sep 17 00:00:00 2001
From: Mark Goddard <mark@stackhpc.com>
Date: Thu, 2 Aug 2018 11:27:27 +0100
Subject: [PATCH] Stabilise Bifrost CI job

The Bifrost CI job seems quite unstable, often failing while attempting
to reach the public epel package repositories. We shouldn't need to
install any packages when deploying the container - they should all have
been installed in the image already.

This change avoids running the scripts/env-setup.sh script, which is run
when the container image is built.

It also removes sourcing of /opt/stack/ansible/hacking/env-setup, which
is now just a stub.

Change-Id: I1786e5337a397cb7b427d6b87c21eaee600af170
---
 ansible/roles/bifrost/tasks/bootstrap.yml      | 2 +-
 ansible/roles/bifrost/tasks/deploy-servers.yml | 6 ++----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/ansible/roles/bifrost/tasks/bootstrap.yml b/ansible/roles/bifrost/tasks/bootstrap.yml
index 442cad658c..ce3b6f29fb 100644
--- a/ansible/roles/bifrost/tasks/bootstrap.yml
+++ b/ansible/roles/bifrost/tasks/bootstrap.yml
@@ -15,7 +15,7 @@
 - name: Bootstrap bifrost (this may take several minutes)
   command: >
      docker exec bifrost_deploy
-     bash -c '/bifrost/scripts/env-setup.sh && source /bifrost/env-vars
+     bash -c 'source /bifrost/env-vars
      && cp /etc/bifrost/rabbitmq-env.conf /etc/rabbitmq/rabbitmq-env.conf &&
      chown rabbitmq:rabbitmq /etc/rabbitmq/rabbitmq-env.conf &&
      ansible-playbook -vvvv -i /bifrost/playbooks/inventory/target
diff --git a/ansible/roles/bifrost/tasks/deploy-servers.yml b/ansible/roles/bifrost/tasks/deploy-servers.yml
index 0fbdd1d9ea..879acfe0ff 100644
--- a/ansible/roles/bifrost/tasks/deploy-servers.yml
+++ b/ansible/roles/bifrost/tasks/deploy-servers.yml
@@ -2,8 +2,7 @@
 - name: Enrolling physical servers with ironic
   command: >
      docker exec bifrost_deploy
-     bash -c 'source /bifrost/env-vars
-     && source /opt/stack/ansible/hacking/env-setup &&
+     bash -c 'source /bifrost/env-vars &&
      export BIFROST_INVENTORY_SOURCE=/etc/bifrost/servers.yml &&
      ansible-playbook -vvvv -i /bifrost/playbooks/inventory/bifrost_inventory.py
      /bifrost/playbooks/enroll-dynamic.yaml -e @/etc/bifrost/bifrost.yml'
@@ -11,8 +10,7 @@
 - name: Deploy physical servers with ironic
   command: >
      docker exec bifrost_deploy
-     bash -c 'source /bifrost/env-vars
-     && source /opt/stack/ansible/hacking/env-setup &&
+     bash -c 'source /bifrost/env-vars &&
      export BIFROST_INVENTORY_SOURCE=/etc/bifrost/servers.yml &&
      ansible-playbook -vvvv -i /bifrost/playbooks/inventory/bifrost_inventory.py
      /bifrost/playbooks/deploy-dynamic.yaml -e @/etc/bifrost/bifrost.yml'
-- 
GitLab