Execution
Date
14 Dec 2025 10:21:40 +0000
Duration
00:43:55.98
Controller
aio1.openstack.local
User
root
Versions
Ansible
2.18.6
ara
1.7.4 / 1.7.4
Python
3.13.5
Summary
13
Hosts
2438
Tasks
2413
Results
107
Plays
511
Files
0
Records
File: /home/zuul/src/opendev.org/openstack/openstack-ansible-os_tempest/tasks/tempest_post_install.yml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 | --- # Copyright 2014, Rackspace US, Inc. # Copyright 2018, Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - name: Create tempest directories ansible.builtin.file: path: "{{ item.path }}" state: directory owner: "{{ item.owner | default(omit) }}" group: "{{ item.group | default(omit) }}" mode: "{{ item.mode | default('0755') }}" with_items: - path: "{{ tempest_log_dir | realpath }}" owner: root - path: "{{ tempest_image_dir }}" - path: "{{ tempest_workspace }}" - path: "/etc/tempest" owner: root group: root - name: Copy tempest config openstack.config_template.config_template: src: "tempest.conf.j2" dest: "/etc/tempest/tempest.conf" owner: "root" group: "root" mode: "0644" config_overrides: "{{ _tempest_tempest_conf_overrides_gathered }}" config_type: "ini" register: copy_tempest_config when: not tempest_use_tempestconf | bool - name: Move over workspace when config is updated ansible.builtin.shell: | set -e if [ -d {{ tempest_venv_bin }} ]; then . {{ tempest_venv_bin }}/activate else exit 0 fi if tempest workspace list | grep ' workspace '; then # Get a backup suffix export CURDATE=$(date +"%d%^b%g_%H%M%S%Z") # Get the dirname for 'workspace' directly from the tempest workspace list WSPATH=$(dirname $(tempest workspace list | awk '{if($2 == "workspace"){print $4}}')) # Rename the workspace tempest workspace rename --old-name workspace --new-name workspace_${CURDATE} # A workspace move only changes the config. The move happens manually. if [ -d "${WSPATH}/workspace" ] then mv ${WSPATH}/workspace ${WSPATH}/workspace_${CURDATE} tempest workspace move --name workspace_${CURDATE} --path ${WSPATH}/workspace_${CURDATE}/ fi exit 3 fi args: executable: /bin/bash register: tempest_move_workspace changed_when: tempest_move_workspace.rc == 3 failed_when: - tempest_move_workspace.rc != 0 - tempest_move_workspace.rc != 3 when: - not tempest_use_tempestconf | bool - copy_tempest_config is changed tags: # don't trigger ANSIBLE0016 - skip_ansible_lint - name: Initialise tempest workspace ansible.builtin.shell: | set -e if [ ! -d {{ tempest_workspace }}/etc ]; then if [ -d {{ tempest_venv_bin }} ]; then . {{ tempest_venv_bin }}/activate fi # (guilhermesp) We are adding this conditional here to avoid # breakage when we are upgrade from rocky to stein as the workspace # path has been change between these two releases if tempest workspace list | grep ' workspace '; then # Init not working on existing entry. Renme old workspace instead and init new. export CURDATE=$(date +"%d%^b%g_%H%M%S%Z") WSPATH=$(dirname $(tempest workspace list | awk '{if($2 == "workspace"){print $4}}')) tempest workspace rename --old-name workspace --new-name workspace_${CURDATE} mv ${WSPATH}/workspace ${WSPATH}/workspace_${CURDATE} tempest workspace move --name workspace_${CURDATE} --path ${WSPATH}/workspace_${CURDATE}/ tempest init ${CURWORKSPACE} else tempest init --name workspace {{ tempest_workspace }} exit 3 fi fi args: executable: /bin/bash register: tempest_init_workspace changed_when: tempest_init_workspace.rc == 3 failed_when: - tempest_init_workspace.rc != 0 - tempest_init_workspace.rc != 3 tags: # don't trigger ANSIBLE0013 - skip_ansible_lint - name: Importing tempestconf tasks ansible.builtin.import_tasks: tempestconf.yml when: tempest_use_tempestconf | bool tags: - tempest-config - tempestconf - name: List installed tempest plugins ansible.builtin.shell: | set -e if [ -d {{ tempest_venv_bin }} ]; then . {{ tempest_venv_bin }}/activate fi tempest list-plugins changed_when: false args: executable: /bin/bash when: "debug | bool" - name: List tempest tests ansible.builtin.shell: | set -e if [ -d {{ tempest_venv_bin }} ]; then . {{ tempest_venv_bin }}/activate fi tempest run -l args: chdir: "{{ tempest_workspace }}" executable: /bin/bash when: "debug | bool" changed_when: false - name: Generate tempest test include list ansible.builtin.copy: content: | {% for item in (_tempest_test_includelist + tempest_test_extra_test) | unique | sort %} {% if item %} {{ item }} {% endif %} {% endfor %} dest: "{{ tempest_includelist_file_path }}" mode: "0644" when: - _tempest_test_includelist | length > 0 # Tests to NOT execute: # This sets up a list of tests to skip, which can even include those included in the includelist. - name: Generate tempest test exclude list ansible.builtin.copy: content: | {% for item in _tempest_test_excludelist %} {% if item.test is defined %} {{ item.test }} {% else %} {{ item }} {% endif %} {% endfor %} dest: "{{ tempest_excludelist_file_path }}" mode: "0644" when: - _tempest_test_excludelist | length > 0 - name: Remove tempest test exclude list when there are no exclusions ansible.builtin.file: path: "{{ tempest_excludelist_file_path }}" state: absent when: - _tempest_test_excludelist | length == 0 - name: Drop test_accounts_file ansible.builtin.copy: content: "{{ tempest_test_accounts }}" dest: "{{ tempest_test_accounts_file_path }}" mode: "0644" when: - tempest_test_accounts | length > 0 |