python-tempestconf/roles/generate-accounts-file/tasks/main.yaml
OpenDev Sysadmins 4c66f5cf82 OpenDev Migration Patch
This commit was bulk generated and pushed by the OpenDev sysadmins
as a part of the Git hosting and code review systems migration
detailed in these mailing list posts:

http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003603.html
http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004920.html

Attempts have been made to correct repository namespaces and
hostnames based on simple pattern matching, but it's possible some
were updated incorrectly or missed entirely. Please reach out to us
via the contact information listed at https://opendev.org/ with any
questions you may have.
2019-04-19 19:29:26 +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['opendev.org/openstack/tempest'].src_dir }}"