From 9bdf6b00ccf79ec2d4fc87443c1b711fb47ebff0 Mon Sep 17 00:00:00 2001
From: Maxime Guyot <Miouge1@users.noreply.github.com>
Date: Tue, 17 Dec 2019 16:11:59 +0100
Subject: [PATCH] Remove inline shell in YAML for vagrant-validate (#5386)

---
 .gitlab-ci/lint.yml               | 6 +++---
 tests/scripts/vagrant-validate.sh | 6 ++++++
 2 files changed, 9 insertions(+), 3 deletions(-)
 create mode 100755 tests/scripts/vagrant-validate.sh

diff --git a/.gitlab-ci/lint.yml b/.gitlab-ci/lint.yml
index 7555cbde7..b6a760410 100644
--- a/.gitlab-ci/lint.yml
+++ b/.gitlab-ci/lint.yml
@@ -11,10 +11,10 @@ yamllint:
 vagrant-validate:
   extends: .job
   stage: unit-tests
+  variables:
+    VAGRANT_VERSION: 2.2.4
   script:
-    - curl -sL https://releases.hashicorp.com/vagrant/2.2.4/vagrant_2.2.4_x86_64.deb -o /tmp/vagrant_2.2.4_x86_64.deb
-    - dpkg -i /tmp/vagrant_2.2.4_x86_64.deb
-    - vagrant validate --ignore-provider
+    - ./tests/scripts/vagrant-validate.sh
   except: ['triggers', 'master']
 
 ansible-lint:
diff --git a/tests/scripts/vagrant-validate.sh b/tests/scripts/vagrant-validate.sh
new file mode 100755
index 000000000..1dc6d8ebc
--- /dev/null
+++ b/tests/scripts/vagrant-validate.sh
@@ -0,0 +1,6 @@
+#!/bin/bash
+set -euxo pipefail
+
+curl -sL "https://releases.hashicorp.com/vagrant/2.2.4/vagrant_${VAGRANT_VERSION}_x86_64.deb" -o "/tmp/vagrant_${VAGRANT_VERSION}_x86_64.deb"
+dpkg -i "/tmp/vagrant_${VAGRANT_VERSION}_x86_64.deb"
+vagrant validate --ignore-provider
-- 
GitLab