|
14 | 14 | rally_docker_registry: ghcr.io |
15 | 15 | rally_docker_registry_username: |
16 | 16 | rally_docker_registry_password: |
| 17 | + # Set to true to build the docker-rally image locally. |
| 18 | + docker_rally_build: false |
| 19 | + docker_rally_src_repo: https://github.com/stackhpc/docker-rally |
| 20 | + docker_rally_src_version: HEAD |
17 | 21 | load_list_path_remote: "{{ results_path_remote.path }}/tempest-load-list" |
18 | 22 | skip_list_path_remote: "{{ results_path_remote.path }}/tempest-skip-list" |
19 | 23 | accounts_path_remote: "{{ results_path_remote.path }}/tempest-accounts" |
|
52 | 56 | - rally_docker_registry_password is not none |
53 | 57 | become: true |
54 | 58 |
|
55 | | - - name: Ensure rally image exists on runner |
| 59 | + - when: docker_rally_build | bool |
| 60 | + block: |
| 61 | + - name: Create temporary source directory |
| 62 | + ansible.builtin.tempfile: |
| 63 | + state: directory |
| 64 | + suffix: docker-rally |
| 65 | + register: src_path_remote |
| 66 | + |
| 67 | + - name: Clone docker-rally repository |
| 68 | + git: |
| 69 | + depth: 1 |
| 70 | + dest: "{{ src_path_remote.path }}" |
| 71 | + repo: "{{ docker_rally_src_repo }}" |
| 72 | + single_branch: true |
| 73 | + version: "{{ docker_rally_src_version }}" |
| 74 | + |
| 75 | + - name: Ensure rally image exists on runner (build) |
| 76 | + docker_image: |
| 77 | + build: |
| 78 | + network: host |
| 79 | + path: "{{ src_path_remote.path }}" |
| 80 | + name: "{{ rally_image_full }}" |
| 81 | + state: present |
| 82 | + source: build |
| 83 | + become: true |
| 84 | + |
| 85 | + - name: Ensure rally image exists on runner (pull) |
56 | 86 | docker_image: |
57 | 87 | name: "{{ rally_image_full }}" |
58 | 88 | state: present |
59 | 89 | force_source: "{{ rally_force_pull | bool }}" |
60 | 90 | source: pull |
61 | 91 | become: true |
| 92 | + when: not docker_rally_build | bool |
62 | 93 |
|
63 | 94 | - name: Copy tempest load list to remote host |
64 | 95 | copy: |
|
173 | 204 | path: "{{ cacert_path_remote.path }}" |
174 | 205 | state: absent |
175 | 206 | when: cacert_path_remote.path is defined |
| 207 | + |
| 208 | + - name: cleanup source |
| 209 | + file: |
| 210 | + path: "{{ src_path_remote.path }}" |
| 211 | + state: absent |
| 212 | + when: src_path_remote.path is defined |
0 commit comments