Remove some useless if conditions

This commit is contained in:
Slavi Pantaleev 2021-08-04 14:51:15 +03:00
parent a68ac9cb4f
commit 2697590d28
4 changed files with 16 additions and 16 deletions

View File

@ -40,7 +40,7 @@
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}" source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
force_source: "{{ matrix_mautrix_facebook_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}" force_source: "{{ matrix_mautrix_facebook_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_mautrix_facebook_docker_image_force_pull }}" force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_mautrix_facebook_docker_image_force_pull }}"
when: matrix_mautrix_facebook_enabled|bool and not matrix_mautrix_facebook_container_image_self_build when: not matrix_mautrix_facebook_container_image_self_build
- name: Ensure Mautrix Facebook paths exist - name: Ensure Mautrix Facebook paths exist
file: file:
@ -63,7 +63,7 @@
# version: "{{ matrix_coturn_docker_image.split(':')[1] }}" # version: "{{ matrix_coturn_docker_image.split(':')[1] }}"
force: "yes" force: "yes"
register: matrix_mautrix_facebook_git_pull_results register: matrix_mautrix_facebook_git_pull_results
when: "matrix_mautrix_facebook_enabled|bool and matrix_mautrix_facebook_container_image_self_build" when: "matrix_mautrix_facebook_container_image_self_build|bool"
- name: Ensure Mautrix Facebook Docker image is built - name: Ensure Mautrix Facebook Docker image is built
docker_image: docker_image:
@ -75,7 +75,7 @@
dockerfile: Dockerfile dockerfile: Dockerfile
path: "{{ matrix_mautrix_facebook_docker_src_files_path }}" path: "{{ matrix_mautrix_facebook_docker_src_files_path }}"
pull: yes pull: yes
when: "matrix_mautrix_facebook_enabled|bool and matrix_mautrix_facebook_container_image_self_build|bool" when: "matrix_mautrix_facebook_container_image_self_build|bool"
- name: Check if an old database file already exists - name: Check if an old database file already exists
stat: stat:

View File

@ -40,7 +40,7 @@
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}" source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
force_source: "{{ matrix_mautrix_hangouts_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}" force_source: "{{ matrix_mautrix_hangouts_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_mautrix_hangouts_docker_image_force_pull }}" force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_mautrix_hangouts_docker_image_force_pull }}"
when: matrix_mautrix_hangouts_enabled|bool and not matrix_mautrix_hangouts_container_image_self_build when: not matrix_mautrix_hangouts_container_image_self_build
- name: Ensure Mautrix Hangouts paths exist - name: Ensure Mautrix Hangouts paths exist
file: file:
@ -54,7 +54,7 @@
- { path: "{{ matrix_mautrix_hangouts_config_path }}", when: true } - { path: "{{ matrix_mautrix_hangouts_config_path }}", when: true }
- { path: "{{ matrix_mautrix_hangouts_data_path }}", when: true } - { path: "{{ matrix_mautrix_hangouts_data_path }}", when: true }
- { path: "{{ matrix_mautrix_hangouts_docker_src_files_path }}", when: "{{ matrix_mautrix_hangouts_container_image_self_build }}" } - { path: "{{ matrix_mautrix_hangouts_docker_src_files_path }}", when: "{{ matrix_mautrix_hangouts_container_image_self_build }}" }
when: matrix_mautrix_hangouts_enabled|bool and item.when|bool when: "item.when|bool"
- name: Ensure Mautrix Hangots repository is present on self build - name: Ensure Mautrix Hangots repository is present on self build
git: git:
@ -62,7 +62,7 @@
dest: "{{ matrix_mautrix_hangouts_docker_src_files_path }}" dest: "{{ matrix_mautrix_hangouts_docker_src_files_path }}"
force: "yes" force: "yes"
register: matrix_mautrix_hangouts_git_pull_results register: matrix_mautrix_hangouts_git_pull_results
when: "matrix_mautrix_hangouts_enabled|bool and matrix_mautrix_hangouts_container_image_self_build|bool" when: "matrix_mautrix_hangouts_container_image_self_build|bool"
- name: Ensure Mautrix Hangouts Docker image is built - name: Ensure Mautrix Hangouts Docker image is built
docker_image: docker_image:
@ -74,7 +74,7 @@
dockerfile: Dockerfile dockerfile: Dockerfile
path: "{{ matrix_mautrix_hangouts_docker_src_files_path }}" path: "{{ matrix_mautrix_hangouts_docker_src_files_path }}"
pull: yes pull: yes
when: "matrix_mautrix_hangouts_enabled|bool and matrix_mautrix_hangouts_container_image_self_build|bool" when: "matrix_mautrix_hangouts_container_image_self_build|bool"
- name: Check if an old database file already exists - name: Check if an old database file already exists
stat: stat:

View File

@ -13,7 +13,7 @@
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}" source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
force_source: "{{ matrix_mautrix_instagram_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}" force_source: "{{ matrix_mautrix_instagram_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_mautrix_instagram_docker_image_force_pull }}" force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_mautrix_instagram_docker_image_force_pull }}"
when: matrix_mautrix_instagram_enabled|bool and not matrix_mautrix_instagram_container_image_self_build when: not matrix_mautrix_instagram_container_image_self_build
- name: Ensure Mautrix instagram paths exist - name: Ensure Mautrix instagram paths exist
file: file:
@ -38,7 +38,7 @@
dest: "{{ matrix_mautrix_instagram_docker_src_files_path }}" dest: "{{ matrix_mautrix_instagram_docker_src_files_path }}"
force: "yes" force: "yes"
register: matrix_mautrix_instagram_git_pull_results register: matrix_mautrix_instagram_git_pull_results
when: "matrix_mautrix_instagram_enabled|bool and matrix_mautrix_instagram_container_image_self_build" when: "matrix_mautrix_instagram_container_image_self_build|bool"
- name: Ensure Mautrix instagram Docker image is built - name: Ensure Mautrix instagram Docker image is built
docker_image: docker_image:
@ -50,7 +50,7 @@
dockerfile: Dockerfile dockerfile: Dockerfile
path: "{{ matrix_mautrix_instagram_docker_src_files_path }}" path: "{{ matrix_mautrix_instagram_docker_src_files_path }}"
pull: yes pull: yes
when: "matrix_mautrix_instagram_enabled|bool and matrix_mautrix_instagram_container_image_self_build|bool" when: "matrix_mautrix_instagram_container_image_self_build|bool"
- name: Ensure mautrix-instagram config.yaml installed - name: Ensure mautrix-instagram config.yaml installed
copy: copy:

View File

@ -14,7 +14,7 @@
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}" source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
force_source: "{{ matrix_mautrix_signal_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}" force_source: "{{ matrix_mautrix_signal_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_mautrix_signal_docker_image_force_pull }}" force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_mautrix_signal_docker_image_force_pull }}"
when: "matrix_mautrix_signal_enabled|bool and not matrix_mautrix_signal_container_self_build|bool" when: "not matrix_mautrix_signal_container_self_build|bool"
- name: Ensure Mautrix Signal repository is present on self-build - name: Ensure Mautrix Signal repository is present on self-build
@ -23,7 +23,7 @@
dest: "{{ matrix_mautrix_signal_docker_src_files_path }}" dest: "{{ matrix_mautrix_signal_docker_src_files_path }}"
force: "yes" force: "yes"
register: matrix_mautrix_signal_git_pull_results register: matrix_mautrix_signal_git_pull_results
when: "matrix_mautrix_signal_enabled|bool and matrix_mautrix_signal_container_self_build|bool" when: "matrix_mautrix_signal_container_self_build|bool"
- name: Ensure Mautrix Signal image is built - name: Ensure Mautrix Signal image is built
docker_image: docker_image:
@ -35,7 +35,7 @@
dockerfile: Dockerfile dockerfile: Dockerfile
path: "{{ matrix_mautrix_signal_docker_src_files_path }}" path: "{{ matrix_mautrix_signal_docker_src_files_path }}"
pull: yes pull: yes
when: "matrix_mautrix_signal_enabled|bool and matrix_mautrix_signal_container_self_build|bool" when: "matrix_mautrix_signal_container_self_build|bool"
- name: Ensure Mautrix Signal Daemon image is pulled - name: Ensure Mautrix Signal Daemon image is pulled
@ -53,7 +53,7 @@
dest: "{{ matrix_mautrix_signal_daemon_docker_src_files_path }}" dest: "{{ matrix_mautrix_signal_daemon_docker_src_files_path }}"
force: "yes" force: "yes"
register: matrix_mautrix_signal_daemon_git_pull_results register: matrix_mautrix_signal_daemon_git_pull_results
when: "matrix_mautrix_signal_enabled|bool and matrix_mautrix_signal_daemon_container_self_build|bool" when: "matrix_mautrix_signal_daemon_container_self_build|bool"
- name: Ensure Mautrix Signal Daemon image is built - name: Ensure Mautrix Signal Daemon image is built
docker_image: docker_image:
@ -65,7 +65,7 @@
dockerfile: Dockerfile dockerfile: Dockerfile
path: "{{ matrix_mautrix_signal_daemon_docker_src_files_path }}" path: "{{ matrix_mautrix_signal_daemon_docker_src_files_path }}"
pull: yes pull: yes
when: "matrix_mautrix_signal_enabled|bool and matrix_mautrix_signal_daemon_container_self_build|bool" when: "matrix_mautrix_signal_daemon_container_self_build|bool"
- name: Ensure Mautrix Signal paths exist - name: Ensure Mautrix Signal paths exist
file: file: