49 lines
1.6 KiB
YAML
49 lines
1.6 KiB
YAML
![]() |
---
|
||
|
# Copyright 2016, 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: Download pre-built pypy
|
||
|
get_url:
|
||
|
url: "{{ swift_pypy_archive['url'] }}"
|
||
|
sha256sum: "{{ swift_pypy_archive['sha256'] }}"
|
||
|
dest: "/var/cache/{{ swift_pypy_archive['url'] | basename }}"
|
||
|
force: yes
|
||
|
|
||
|
- name: Create pypy dir
|
||
|
file:
|
||
|
path: "/opt/pypy-runtime"
|
||
|
state: directory
|
||
|
|
||
|
- name: Set pypy version fact
|
||
|
set_fact:
|
||
|
swift_pypy_version: "{{ swift_pypy_archive['url'] | basename | replace('.tar.bz2', '') }}"
|
||
|
|
||
|
- name: Set pypy env fact
|
||
|
set_fact:
|
||
|
swift_pypy_env: "/opt/pypy-runtime/{{ swift_pypy_version }}/bin/pypy"
|
||
|
|
||
|
- name: Unarchive pre-built pypy
|
||
|
unarchive:
|
||
|
src: "/var/cache/{{ swift_pypy_archive['url'] | basename }}"
|
||
|
dest: "/opt/pypy-runtime"
|
||
|
copy: "no"
|
||
|
creates: "/opt/pypy-runtime/{{ swift_pypy_version }}/bin/pypy"
|
||
|
|
||
|
- name: Change virtualenv python to pypy
|
||
|
shell: |
|
||
|
virtualenv --python {{ swift_pypy_env }} "{{ swift_venv_bin | dirname }}"
|
||
|
touch "{{ swift_venv_bin | dirname }}/{{ swift_pypy_version }}-inuse"
|
||
|
args:
|
||
|
creates: "{{ swift_venv_bin | dirname }}/{{ swift_pypy_version }}-inuse"
|