Make hookshot variable names consistent with the rest of the playbook

Related to https://github.com/spantaleev/matrix-docker-ansible-deploy/pull/2256
This commit is contained in:
Slavi Pantaleev
2022-11-30 08:13:39 +02:00
parent a2f0bcc4a3
commit 7e2e2626a0
4 changed files with 94 additions and 72 deletions

View File

@ -1,5 +1,34 @@
---
- name: (Deprecation) Catch and report renamed Hookshot variables
ansible.builtin.fail:
msg: >-
Your configuration contains a variable, which now has a different name.
Please change your configuration to rename the variable (`{{ item.old }}` -> `{{ item.new }}`).
when: "item.old in vars"
with_items:
- {'old': 'matrix_hookshot_feeds_interval', 'new': 'matrix_hookshot_feeds_pollIntervalSeconds'}
- {'old': 'matrix_hookshot_generic_urlprefix', 'new': 'matrix_hookshot_generic_urlPrefix'}
- {'old': 'matrix_hookshot_generic_allow_js_transformation_functions', 'new': 'matrix_hookshot_generic_allowJsTransformationFunctions'}
- {'old': 'matrix_hookshot_generic_user_id_prefix', 'new': 'matrix_hookshot_generic_userIdPrefix'}
- {'old': 'matrix_hookshot_github_secret', 'new': 'matrix_hookshot_github_webhook_secret'}
- {'old': 'matrix_hookshot_github_appid', 'new': 'matrix_hookshot_github_auth_id'}
- {'old': 'matrix_hookshot_github_oauth_id', 'new': 'matrix_hookshot_github_oauth_client_id'}
- {'old': 'matrix_hookshot_github_oauth_secret', 'new': 'matrix_hookshot_github_oauth_client_secret'}
- {'old': 'matrix_hookshot_github_oauth_uri', 'new': 'matrix_hookshot_github_oauth_redirect_uri'}
- {'old': 'matrix_hookshot_github_ignore_hooks', 'new': 'matrix_hookshot_github_defaultOptions_ignoreHooks'}
- {'old': 'matrix_hookshot_github_command_prefix', 'new': 'matrix_hookshot_github_defaultOptions_commandPrefix'}
- {'old': 'matrix_hookshot_github_showIssueRoomLink', 'new': 'matrix_hookshot_github_defaultOptions_showIssueRoomLink'}
- {'old': 'matrix_hookshot_github_pr_diff', 'new': 'matrix_hookshot_github_defaultOptions_prDiff'}
- {'old': 'matrix_hookshot_github_including_labels', 'new': 'matrix_hookshot_github_defaultOptions_includingLabels'}
- {'old': 'matrix_hookshot_github_excluding_labels', 'new': 'matrix_hookshot_github_defaultOptions_excludingLabels'}
- {'old': 'matrix_hookshot_github_hotlink_prefix', 'new': 'matrix_hookshot_github_defaultOptions_hotlinkIssues_prefix'}
- {'old': 'matrix_hookshot_jira_secret', 'new': 'matrix_hookshot_jira_webhook_secret'}
- {'old': 'matrix_hookshot_jira_oauth_id', 'new': 'matrix_hookshot_jira_oauth_client_id'}
- {'old': 'matrix_hookshot_jira_oauth_secret', 'new': 'matrix_hookshot_jira_oauth_client_secret'}
- {'old': 'matrix_hookshot_jira_oauth_uri', 'new': 'matrix_hookshot_jira_oauth_client_secret'}
- {'old': 'matrix_hookshot_gitlab_secret', 'new': 'matrix_hookshot_gitlab_webhook_secret'}
- name: Fail if required settings not defined
ansible.builtin.fail:
msg: >-
@ -15,8 +44,8 @@
You need to define a required configuration setting (`{{ item }}`) to enable GitHub.
when: "matrix_hookshot_github_enabled and vars[item] == ''"
with_items:
- "matrix_hookshot_github_appid"
- "matrix_hookshot_github_secret"
- "matrix_hookshot_github_auth_id"
- "matrix_hookshot_github_webhook_secret"
- name: Fail if required GitHub OAuth settings not defined
ansible.builtin.fail:
@ -24,8 +53,8 @@
You need to define a required configuration setting (`{{ item }}`) to enable GitHub OAuth.
when: "matrix_hookshot_github_oauth_enabled and vars[item] == ''"
with_items:
- "matrix_hookshot_github_oauth_id"
- "matrix_hookshot_github_oauth_secret"
- "matrix_hookshot_github_oauth_client_id"
- "matrix_hookshot_github_oauth_client_secret"
- name: Fail if required Jira settings not defined
ansible.builtin.fail:
@ -33,7 +62,7 @@
You need to define a required configuration setting (`{{ item }}`) to enable Jira.
when: "matrix_hookshot_jira_enabled and vars[item] == ''"
with_items:
- "matrix_hookshot_jira_secret"
- "matrix_hookshot_jira_webhook_secret"
- name: Fail if required Jira OAuth settings not defined
ansible.builtin.fail:
@ -41,14 +70,14 @@
You need to define a required configuration setting (`{{ item }}`) to enable Jira OAuth.
when: "matrix_hookshot_jira_oauth_enabled and vars[item] == ''"
with_items:
- "matrix_hookshot_jira_oauth_id"
- "matrix_hookshot_jira_oauth_secret"
- "matrix_hookshot_jira_oauth_client_id"
- "matrix_hookshot_jira_oauth_client_secret"
- name: Fail if required Figma settings not defined
ansible.builtin.fail:
msg: >-
You need to define at least one Figma instance to enable Figma.
when: "matrix_hookshot_figma_enabled and matrix_hookshot_figma_instances is undefined"
You need to define at least one Figma instance in `matrix_hookshot_figma_instances` to enable Figma.
when: "matrix_hookshot_figma_enabled and matrix_hookshot_figma_instances | length == 0"
- name: Fail if required provisioning settings not defined
ansible.builtin.fail:
@ -58,15 +87,6 @@
with_items:
- "matrix_hookshot_provisioning_secret"
- name: (Deprecation) Catch and report renamed Hookshot variables
ansible.builtin.fail:
msg: >-
Your configuration contains a variable, which now has a different name.
Please change your configuration to rename the variable (`{{ item.old }}` -> `{{ item.new }}`).
when: "item.old in vars"
with_items:
- {'old': 'matrix_hookshot_feeds_interval', 'new': 'matrix_hookshot_feeds_pollIntervalSeconds'}
- name: (Deprecation) Catch and report old metrics usage
ansible.builtin.fail:
msg: >-