python-tempestconf/roles/generate-accounts-file/tasks/main.yaml
Martin Kopec 93297b18d3 Different concurrency for tempest and accounts
It's better to generate more accounts in accounts.yaml file, otherwise
some tests may fail because they are trying to access certain credentials
with certian roles which are being used by other tests at that moment.

Change-Id: I698b1b83864009a299ca51c10f8a36e73793369d
2018-11-16 00:13:33 +00:00

81 lines
2.3 KiB
YAML

- block:
- name: Create tempest venv with latest pip, setuptools and pbr
pip:
virtualenv: "{{ virtualenvs.tempest }}"
name: "{{ item }}"
state: latest
with_items:
- pip
- setuptools
- pbr
- name: Install tempest
pip:
name: "."
virtualenv: "{{ virtualenvs.tempest }}"
chdir: "{{ tempest_src_relative_path }}"
# Need to have these tasks until this bug:
# https://bugs.launchpad.net/tempest/+bug/1624066 is resolved
# (mkopec) The bug should be resolved, but it's probably not,
# so meanwhile let's have these tasks
- name: Backup etc/tempest.conf if exists
shell: |
mv ./etc/tempest.conf ./etc/tempest.conf.orig
ignore_errors: yes
args:
executable: /bin/bash
chdir: "{{ tempest_src_relative_path }}"
- name: Copy the provided tempest.conf to etc/
become: yes
shell: |
set -ex
cp {{ tempest_config_file }} ./etc/tempest.conf
ls -all ./etc/
args:
executable: /bin/bash
chdir: "{{ tempest_src_relative_path }}"
- name: Generate tempest accounts.yaml file
shell: |
set -ex
export PATH=$PATH:/usr/local/sbin:/usr/sbin
source {{ virtualenvs.tempest }}/bin/activate
{{ source_credentials_commands }}
printenv
tempest account-generator \
--config-file ./etc/tempest.conf \
--concurrency {{ tempest_account_concurrency }} \
etc/accounts.yaml
args:
executable: /bin/bash
chdir: "{{ tempest_src_relative_path }}"
- name: Restore etc/tempest.conf
shell: |
mv ./etc/tempest.conf.orig ./etc/tempest.conf
ignore_errors: yes
args:
executable: /bin/bash
chdir: "{{ tempest_src_relative_path }}"
- name: Cat generated accounts.yaml file
shell: |
cat ./etc/accounts.yaml
args:
executable: /bin/bash
chdir: "{{ tempest_src_relative_path }}"
- name: Copy generated accounts.yaml file
become: yes
shell: |
cp ./etc/accounts.yaml {{ accounts_file_destination }}/accounts.yaml
args:
executable: /bin/bash
chdir: "{{ tempest_src_relative_path }}"
when: accounts_file_destination is defined
vars:
tempest_src_relative_path: "{{ zuul.projects['git.openstack.org/openstack/tempest'].src_dir }}"