From 6bb1f6046b692ee2038eafd0965bd3095d6fa787 Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Wed, 22 Nov 2017 02:06:55 -0500 Subject: [PATCH] Setup virtualenv for zuul-cloner The zuul-cloner shim require PyYAML as a dependency, create a virtualenv and install it. This replaces the destination with virtualenv variable. Change-Id: I3e55a3a1582aa7dea21c7de67260c2c906c2192b Signed-off-by: Paul Belanger --- roles/fetch-zuul-cloner/defaults/main.yaml | 1 + roles/fetch-zuul-cloner/tasks/main.yaml | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 roles/fetch-zuul-cloner/defaults/main.yaml diff --git a/roles/fetch-zuul-cloner/defaults/main.yaml b/roles/fetch-zuul-cloner/defaults/main.yaml new file mode 100644 index 000000000..296ad19f9 --- /dev/null +++ b/roles/fetch-zuul-cloner/defaults/main.yaml @@ -0,0 +1 @@ +virtualenv: /usr/zuul-env diff --git a/roles/fetch-zuul-cloner/tasks/main.yaml b/roles/fetch-zuul-cloner/tasks/main.yaml index eec70aa02..63d301b24 100644 --- a/roles/fetch-zuul-cloner/tasks/main.yaml +++ b/roles/fetch-zuul-cloner/tasks/main.yaml @@ -1,18 +1,18 @@ -- name: Create zuul-cloner destination directory - file: - path: "{{ destination | dirname }}" - state: directory +- name: Install zuul-cloner shim dependencies + pip: + name: PyYAML + virtualenv: "{{ virtualenv }}" become: yes - name: Install zuul-cloner shim template: src: templates/zuul-cloner-shim.py.j2 - dest: "{{ destination }}" + dest: "{{ virtualenv }}/bin/zuul-cloner" become: yes - name: Change zuul-cloner permissions file: - path: "{{ destination }}" + path: "{{ virtualenv }}/bin/zuul-cloner" mode: 0755 become: yes