Skip to content

Commit 358b348

Browse files
committed
Group matrix-registration-bot's self-building tasks in a block
1 parent 47a3372 commit 358b348

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

roles/custom/matrix-bot-matrix-registration-bot/tasks/setup_install.yml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -33,28 +33,28 @@
3333
delay: "{{ devture_playbook_help_container_retries_delay }}"
3434
until: result is not failed
3535

36-
- name: Ensure matrix-registration-bot repository is present on self-build
37-
ansible.builtin.git:
38-
repo: "{{ matrix_bot_matrix_registration_bot_docker_repo }}"
39-
version: "{{ matrix_bot_matrix_registration_bot_docker_repo_version }}"
40-
dest: "{{ matrix_bot_matrix_registration_bot_docker_src_files_path }}"
41-
force: "yes"
42-
become: true
43-
become_user: "{{ matrix_user_username }}"
44-
register: matrix_bot_matrix_registration_bot_git_pull_results
45-
when: "matrix_bot_matrix_registration_bot_container_image_self_build | bool"
36+
- when: matrix_bot_matrix_registration_bot_container_image_self_build | bool
37+
block:
38+
- name: Ensure matrix-registration-bot repository is present on self-build
39+
ansible.builtin.git:
40+
repo: "{{ matrix_bot_matrix_registration_bot_docker_repo }}"
41+
version: "{{ matrix_bot_matrix_registration_bot_docker_repo_version }}"
42+
dest: "{{ matrix_bot_matrix_registration_bot_docker_src_files_path }}"
43+
force: "yes"
44+
become: true
45+
become_user: "{{ matrix_user_username }}"
46+
register: matrix_bot_matrix_registration_bot_git_pull_results
4647

47-
- name: Ensure matrix-registration-bot image is built
48-
community.docker.docker_image:
49-
name: "{{ matrix_bot_matrix_registration_bot_docker_image }}"
50-
source: build
51-
force_source: "{{ matrix_bot_matrix_registration_bot_git_pull_results.changed if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
52-
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_bot_matrix_registration_bot_git_pull_results.changed }}"
53-
build:
54-
dockerfile: Dockerfile
55-
path: "{{ matrix_bot_matrix_registration_bot_docker_src_files_path }}"
56-
pull: true
57-
when: "matrix_bot_matrix_registration_bot_container_image_self_build | bool"
48+
- name: Ensure matrix-registration-bot image is built
49+
community.docker.docker_image:
50+
name: "{{ matrix_bot_matrix_registration_bot_docker_image }}"
51+
source: build
52+
force_source: "{{ matrix_bot_matrix_registration_bot_git_pull_results.changed if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
53+
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_bot_matrix_registration_bot_git_pull_results.changed }}"
54+
build:
55+
dockerfile: Dockerfile
56+
path: "{{ matrix_bot_matrix_registration_bot_docker_src_files_path }}"
57+
pull: true
5858

5959
- name: Ensure matrix-registration-bot container network is created
6060
community.general.docker_network:

0 commit comments

Comments
 (0)