Skip some tasks when not necessary to run them

This commit is contained in:
Slavi Pantaleev 2019-03-08 12:14:54 +02:00
parent ae7e17e64a
commit 390ec8a599
4 changed files with 12 additions and 0 deletions

View File

@ -39,6 +39,7 @@
stat:
path: "{{ matrix_appservice_discord_base_path }}/discord-registration.yaml"
register: appservice_discord_registration_file
when: "matrix_appservice_discord_enabled"
- name: Generate matrix-appservice-discord discord-registration.yaml if it doesn't exist
shell: >-
@ -57,11 +58,13 @@
- set_fact:
matrix_synapse_app_service_config_file_appservice_discord: '{{ matrix_appservice_discord_base_path }}/discord-registration.yml'
when: "matrix_appservice_discord_enabled"
- name: Check if a matrix-appservice-discord invite_link file exists
stat:
path: "{{ matrix_appservice_discord_base_path }}/invite_link"
register: appservice_discord_link_generated
when: "matrix_appservice_discord_enabled"
- name: Generate your discord invite link
shell: >-

View File

@ -26,6 +26,7 @@
stat:
path: "{{ matrix_appservice_irc_base_path }}/passkey.pem"
register: irc_passkey_file
when: "matrix_appservice_irc_enabled"
- name: Generate matrix-appservice-irc passkey if it doesn't exist
shell: /usr/bin/openssl genpkey -out {{ matrix_appservice_irc_base_path }}/passkey.pem -outform PEM -algorithm RSA -pkeyopt rsa_keygen_bits:2048
@ -48,6 +49,7 @@
stat:
path: "{{ matrix_appservice_irc_base_path }}/registration.yaml"
register: appservice_irc_registration_file
when: "matrix_appservice_irc_enabled"
- name: Generate matrix-appservice-irc registration.yaml if it doesn't exist
shell: >-
@ -64,6 +66,7 @@
- set_fact:
matrix_synapse_app_service_config_file_appservice_irc: '/app-registration/appservice-irc.yml'
when: "matrix_appservice_irc_enabled"
- set_fact:
matrix_synapse_container_additional_volumes: >

View File

@ -18,6 +18,7 @@
stat:
path: "{{ matrix_mautrix_telegram_base_path }}/config.yaml"
register: mautrix_telegram_config_file_stat
when: "matrix_mautrix_telegram_enabled"
- name: Ensure Matrix Mautrix telegram config installed
template:
@ -56,6 +57,7 @@
stat:
path: "{{ matrix_mautrix_telegram_base_path }}/registration.yaml"
register: mautrix_telegram_registration_file_stat
when: "matrix_mautrix_telegram_enabled"
- name: Generate matrix-mautrix-telegram registration.yaml if it doesn't exist
shell:
@ -72,6 +74,7 @@
- set_fact:
matrix_synapse_app_service_config_file_mautrix_telegram: '/app-registration/mautrix-telegram.yml'
when: "matrix_mautrix_telegram_enabled"
- set_fact:
matrix_synapse_container_additional_volumes: >

View File

@ -18,6 +18,7 @@
stat:
path: "{{ matrix_mautrix_whatsapp_base_path }}/config.yaml"
register: mautrix_whatsapp_config_file_stat
when: "matrix_mautrix_whatsapp_enabled"
- name: Ensure Matrix Mautrix whatsapp config installed
template:
@ -45,6 +46,7 @@
stat:
path: "{{ matrix_mautrix_whatsapp_base_path }}/registration.yaml"
register: mautrix_whatsapp_registration_file_stat
when: "matrix_mautrix_whatsapp_enabled"
- name: Generate matrix-mautrix-whatsapp registration.yaml if it doesn't exist
shell:
@ -61,6 +63,7 @@
- set_fact:
matrix_synapse_app_service_config_file_mautrix_whatsapp: '/app-registration/mautrix-whatsapp.yml'
when: "matrix_mautrix_whatsapp_enabled"
- set_fact:
matrix_synapse_container_additional_volumes: >