ansible-role-refstack-client/tasks/generate-accounts.yaml
Martin Kopec 3a3fb4f48b Fix linters python3.10 issues
Bump the version of ansible-lint and fix all warnings and failures
found by ansible-lint.
Also remove any python2 related code/tasks from
install-packages.yaml

Change-Id: If466227fb9872f1112b4577670c891bef5b31627
2023-06-22 00:08:33 +02:00

75 lines
2.2 KiB
YAML

---
- name: Generate tempest_admin.conf as admin
ansible.builtin.shell: |
set -ex
source .venv/bin/activate
source {{ source_admin_credentials }}
discover-tempest-config \
--debug \
-v \
--create \
--image {{ url_cirros_image }} \
--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
ansible.builtin.shell: |
set -ex
source .venv/bin/activate
source {{ source_admin_credentials }}
discover-tempest-config \
--debug \
-v \
--create \
--image {{ url_cirros_image }} \
--out ./etc/tempest_admin.conf \
{{ additional_tempestconf_params }}
args:
executable: /bin/bash
chdir: "{{ refstack_client_source }}"
when: additional_tempestconf_params is defined
- name: Cat generated tempest_admin.conf file
ansible.builtin.shell: |
cat ./etc/tempest_admin.conf
args:
executable: /bin/bash
chdir: "{{ refstack_client_source }}"
changed_when: false
- name: Set path to tempest_admin.conf
ansible.builtin.set_fact:
path_to_admin_tempest_config: "{{ refstack_client_source }}/etc/tempest_admin.conf"
- name: Generate tempest accounts.yaml file
ansible.builtin.shell: |
set -ex
export PATH=$PATH:/usr/local/sbin:/usr/sbin
source .tempest/.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
ansible.builtin.shell: |
cat ./etc/accounts.yaml
args:
executable: /bin/bash
chdir: "{{ refstack_client_source }}"
changed_when: false
- name: Set path to newly generated accounts.yaml
ansible.builtin.set_fact:
path_to_accounts_file: "{{ refstack_client_source }}/etc/accounts.yaml"