5848fa9ef8
The venvs directory will be created during the repo server playbook. Creating it a second time during the repo build process is unnecessary. This change removes the creation of the venvs directory during the repo build process. Depends-On: If1dd5e568e06715f4321c391727d428e2e0805ea Change-Id: I50876f0443a958ec8433226ec7f6738347205f0a
90 lines
2.8 KiB
YAML
90 lines
2.8 KiB
YAML
---
|
|
# Copyright 2015, Rackspace US, Inc.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
- name: Create venv directories
|
|
file:
|
|
path: "{{ repo_build_venv_dir }}"
|
|
state: "directory"
|
|
owner: "{{ repo_build_service_user_name }}"
|
|
mode: 02755
|
|
|
|
- name: Get venv command path
|
|
command: which virtualenv
|
|
changed_when: false
|
|
register: virtualenv_path
|
|
|
|
- name: Set virtualenv command path
|
|
set_fact:
|
|
virtualenv_bin: "{{ virtualenv_path.stdout }}"
|
|
|
|
# This is removed so that virtual env is not installing unknown
|
|
# packages as assumed wheels, IE pip8
|
|
- name: Ensure virtualenv_support is absent
|
|
file:
|
|
path: "{{ item }}"
|
|
state: "absent"
|
|
with_items:
|
|
- "/usr/local/lib/python2.7/dist-packages/virtualenv_support"
|
|
- "/usr/local/lib/python2.7/site-packages/virtualenv_support"
|
|
|
|
- name: Create venv build script
|
|
template:
|
|
src: "venv-build-script.sh.j2"
|
|
dest: "/opt/venv-build-script.sh"
|
|
mode: "0755"
|
|
|
|
- name: Create venv build options files
|
|
template:
|
|
src: "venv-build-options.txt.j2"
|
|
dest: "{{ repo_build_release_path }}/venv-build-options-{{ item['role_name'] }}.txt"
|
|
with_items: "{{ filtered_venv_role_python_requirements }}"
|
|
register: _create_venv_options_files
|
|
|
|
- name: Execute the venv build scripts asynchonously
|
|
shell: "/opt/venv-build-script.sh {{ repo_build_release_path }}/venv-build-options-{{ item['item']['role_name'] }}.txt"
|
|
args:
|
|
executable: "/bin/bash"
|
|
when:
|
|
- (item | changed) or
|
|
(ansible_local['openstack_ansible']['repo_build']['need_venv_build'] | bool)
|
|
with_items:
|
|
- "{{ _create_venv_options_files.results }}"
|
|
register: _build_venv
|
|
async: "{{ repo_build_venv_timeout * 60 }}"
|
|
poll: 0
|
|
# This task requires the use of the shell module, so we skip lint
|
|
# to avoid:
|
|
# ANSIBLE0013 Use shell only when shell functionality is required
|
|
tags:
|
|
- skip_ansible_lint
|
|
|
|
- name: Wait for the venvs builds to complete
|
|
async_status:
|
|
jid: "{{ item['ansible_job_id'] }}"
|
|
register: _venv_jobs
|
|
until: _venv_jobs['finished'] | bool
|
|
delay: 10
|
|
retries: "{{ repo_build_venv_timeout * 6 }}"
|
|
with_items: "{{ _build_venv['results'] }}"
|
|
when:
|
|
- item['ansible_job_id'] is defined
|
|
|
|
- name: Disable the venv build requirement now that it is complete
|
|
ini_file:
|
|
dest: "/etc/ansible/facts.d/openstack_ansible.fact"
|
|
section: repo_build
|
|
option: need_venv_build
|
|
value: False
|