ansible-role-refstack-client/tasks/generate-accounts.yaml
Martin Kopec f448d8c15d Run add-ons tests as well
Run tests of all target programs we have.
The patch enables required services in devstack (environment
the tests are executed on in Zuul) and implements a logic when
share config options which can be discovered only by using admin
credentials are passed to the second tempestconf execution
(with demo creds) so that they are set in tempest.conf used to run
refstack-client.

Change-Id: I79b7611f47d7d67d439e24c2427ee59870732172
2021-04-11 08:11:18 +00:00

74 lines
2.1 KiB
YAML

---
- name: Generate tempest_admin.conf as admin
shell: |
set -ex
source .venv/bin/activate
source {{ source_admin_credentials }}
discover-tempest-config \
--debug \
-v \
--create \
--out ./etc/tempest_admin.conf
args:
executable: /bin/bash
chdir: "{{ refstack_client_source }}"
when: additional_tempestconf_params is not defined
- name: Generate tempest_admin.conf as admin additional params
shell: |
set -ex
source .venv/bin/activate
source {{ source_admin_credentials }}
discover-tempest-config \
--debug \
-v \
--create \
--out ./etc/tempest_admin.conf \
{{ additional_tempestconf_params }} \
image.http_image {{ url_cirros_image }}
args:
executable: /bin/bash
chdir: "{{ refstack_client_source }}"
when: additional_tempestconf_params is defined
- name: Cat generated tempest_admin.conf file
shell: |
cat ./etc/tempest_admin.conf
args:
executable: /bin/bash
chdir: "{{ refstack_client_source }}"
changed_when: false
- name: Set path to tempest_admin.conf
set_fact:
path_to_admin_tempest_config: "{{ refstack_client_source }}/etc/tempest_admin.conf"
- name: Generate tempest accounts.yaml file
shell: |
set -ex
export PATH=$PATH:/usr/local/sbin:/usr/sbin
source .venv/bin/activate
source {{ source_admin_credentials }}
printenv
tempest account-generator \
--config-file ./etc/tempest_admin.conf \
--concurrency {{ tempest_account_concurrency }} \
{{ '"shared_file_system" in refstack_target_programs' | ternary('--with-admin', '') }} \
./etc/accounts.yaml
args:
executable: /bin/bash
chdir: "{{ refstack_client_source }}"
changed_when: accounts_path is not defined
- name: Cat generated accounts.yaml file
shell: |
cat ./etc/accounts.yaml
args:
executable: /bin/bash
chdir: "{{ refstack_client_source }}"
changed_when: false
- name: Set path to newly generated accounts.yaml
set_fact:
path_to_accounts_file: "{{ refstack_client_source }}/etc/accounts.yaml"