
Since ansible-core 2.10 it is recommended to use modules via FQCN In order to align with recommendation, we perform migration by applying suggestions made by `ansible-lint --fix=fqcn` Change-Id: I8aeb87463ef50eae78833c9cf070293ea08ce0b7
82 lines
2.7 KiB
YAML
82 lines
2.7 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
|
|
ansible.builtin.get_url:
|
|
url: "{{ swift_pypy_archive['url'] }}"
|
|
checksum: "{{ swift_pypy_archive['checksum'] }}"
|
|
dest: "/var/cache/{{ swift_pypy_archive['url'] | basename }}"
|
|
force: true
|
|
mode: "0644"
|
|
|
|
- name: Create pypy dir
|
|
ansible.builtin.file:
|
|
path: "/opt/pypy-runtime"
|
|
state: directory
|
|
mode: "0755"
|
|
|
|
- name: Unarchive pre-built pypy
|
|
ansible.builtin.unarchive:
|
|
src: "/var/cache/{{ swift_pypy_archive['url'] | basename }}"
|
|
dest: "/opt/pypy-runtime"
|
|
copy: "no"
|
|
creates: "/opt/pypy-runtime/{{ swift_pypy_version }}/bin/pypy"
|
|
register: local_pypy
|
|
|
|
- name: Setup local pypy
|
|
ansible.builtin.command: "{{ item }}"
|
|
changed_when: false
|
|
with_items:
|
|
- "{{ swift_pypy_env }} /opt/get-pip.py"
|
|
- "{{ swift_pypy_env | dirname }}/pip install --upgrade virtualenv"
|
|
when:
|
|
- local_pypy is changed
|
|
|
|
- name: Check for pypy venv
|
|
ansible.builtin.stat:
|
|
path: "{{ swift_bin | dirname }}/{{ swift_pypy_version }}-inuse"
|
|
get_checksum: false
|
|
register: local_pypy_venv_stat
|
|
|
|
- name: Remove existing venv if not pypy setup
|
|
ansible.builtin.file:
|
|
path: "{{ swift_bin | dirname }}"
|
|
state: absent
|
|
when: not local_pypy_venv_stat.stat.exists | bool
|
|
|
|
- name: Install pip packages into pypy venv
|
|
ansible.builtin.pip:
|
|
name: "{{ swift_pip_packages }}"
|
|
state: "{{ swift_pip_package_state }}"
|
|
virtualenv: "{{ swift_bin | dirname }}"
|
|
virtualenv_site_packages: "no"
|
|
virtualenv_command: "{{ swift_pypy_env | dirname }}/virtualenv"
|
|
extra_args: >-
|
|
{{ swift_developer_mode | ternary(pip_install_developer_constraints | default('--constraint /opt/developer-pip-constraints.txt'), '') }}
|
|
{{ (pip_install_upper_constraints is defined) | ternary('--constraint ' + pip_install_upper_constraints | default(''), '') }}
|
|
{{ pip_install_options | default('') }}
|
|
register: install_packages
|
|
until: install_packages is success
|
|
retries: 5
|
|
delay: 2
|
|
notify:
|
|
- Restart swift services
|
|
|
|
- name: Mark swift venv for use with pypy
|
|
ansible.builtin.file:
|
|
path: "{{ swift_bin | dirname }}/{{ swift_pypy_version }}-inuse"
|
|
state: "touch"
|
|
mode: "0644"
|