ansible-role-refstack-client/tasks/install-refstack-client.yaml
Martin Kopec 30c7a1301d Do not run orchestration program by default and fix lint
Don't run heat tempest tests by default until they're fixed.
Most of them currently fail, it seems, they are incompatible
with the latest gabbi.

The patch fixes 'All tasks should be named' linters error.
and bumps version of the linters which includes a fix for
the linters issue:
ImportError: cannot import name 'render_group'

Install python-manilaclient from source so that it contains
latest (not yet packaged) changes.

Change-Id: Idd9180ecbe396f73a03922982a4e005a84a77d02
2022-01-18 07:43:38 +00:00

74 lines
2.5 KiB
YAML

---
- name: Check if refstack_client_source dir exists and if it's empty
find:
paths: "{{ refstack_client_source }}"
register: local_refstack_found
- name: Print refstack_client_source variable
debug:
var: refstack_client_source
- name: Clone refstack-client
git:
repo: 'https://opendev.org/openinfra/refstack-client.git'
dest: "{{ refstack_client_source }}"
version: "{{ refstack_client_version }}"
when: local_refstack_found.matched == 0
- name: Look for python3
command: "python3 --version"
ignore_errors: true
register: python3_is_available
changed_when: false
- name: Set python3 params for setup_env
set_fact:
python3_param: "-p 3"
when: python3_is_available.rc == 0
- name: Clone py2 python-tempestconf
git:
repo: 'https://git.openstack.org/openinfra/python-tempestconf.git'
dest: "{{ refstack_client_source }}/.tempestconf_source"
version: "2.5.0"
when:
- python3_is_available.rc != 0
- tempestconf_source is not defined
- when: refstack_tempest_plugins is defined
block:
# refstack-client allows installation of additional packages to find more
# tests by tempest. The additional tempest plugins should be defined in
# "tempest-additional-requirements.txt" file. This block enables this
# option by using "refstack_tempest_plugins" parameter.
# Usage:
# refstack_tempest_plugins: ===> refstack_tempest_plugins:
# <tempest_plugin_name>:<tag/branch> ===> manila:1.3.0
- name: Add additional requirements for external test suites
replace:
path: "{{ refstack_client_source }}/setup_env"
regexp: '#(.*tempest-additional-requirements.txt$)'
replace: '\1'
- name: Add tempest plugins to tempest-additional-requirements.txt
lineinfile:
path: "{{ refstack_client_source }}/tempest-additional-requirements.txt"
line: "git+https://opendev.org/openstack/{{ item.key }}-tempest-plugin.git@{{ item.value }}"
with_dict: "{{ refstack_tempest_plugins }}"
- name: Install refstack-client
shell: >
./setup_env {{ python3_param | default('') }}
{% if tempest_tag is defined %}
-t {{ tempest_tag }}
{% endif %}
{% if tempestconf_source is defined %}
-s {{ tempestconf_source }}
{% endif %}
{% if tempestconf_source is not defined and python3_is_available.rc != 0 %}
-s {{ refstack_client_source }}/.tempestconf_source
{% endif %}
args:
chdir: "{{ refstack_client_source }}"
changed_when: true