Files
.config
.github
LICENSES
bin
collections
docs
examples
group_vars
i18n
roles
custom
matrix-alertmanager-receiver
matrix-appservice-double-puppet
matrix-appservice-draupnir-for-all
matrix-authentication-service
matrix-base
matrix-bot-baibot
matrix-bot-buscarron
matrix-bot-chatgpt
defaults
tasks
install.yml
main.yml
uninstall.yml
validate_config.yml
templates
matrix-bot-draupnir
matrix-bot-go-neb
matrix-bot-honoroit
matrix-bot-matrix-registration-bot
matrix-bot-matrix-reminder-bot
matrix-bot-maubot
matrix-bot-mjolnir
matrix-bridge-appservice-discord
matrix-bridge-appservice-irc
matrix-bridge-appservice-kakaotalk
matrix-bridge-appservice-slack
matrix-bridge-appservice-webhooks
matrix-bridge-beeper-linkedin
matrix-bridge-go-skype-bridge
matrix-bridge-heisenbridge
matrix-bridge-hookshot
matrix-bridge-mautrix-bluesky
matrix-bridge-mautrix-discord
matrix-bridge-mautrix-facebook
matrix-bridge-mautrix-gmessages
matrix-bridge-mautrix-googlechat
matrix-bridge-mautrix-instagram
matrix-bridge-mautrix-meta-instagram
matrix-bridge-mautrix-meta-messenger
matrix-bridge-mautrix-signal
matrix-bridge-mautrix-slack
matrix-bridge-mautrix-telegram
matrix-bridge-mautrix-twitter
matrix-bridge-mautrix-whatsapp
matrix-bridge-mautrix-wsproxy
matrix-bridge-mx-puppet-discord
matrix-bridge-mx-puppet-groupme
matrix-bridge-mx-puppet-instagram
matrix-bridge-mx-puppet-slack
matrix-bridge-mx-puppet-steam
matrix-bridge-mx-puppet-twitter
matrix-bridge-postmoogle
matrix-bridge-sms
matrix-bridge-wechat
matrix-cactus-comments
matrix-cactus-comments-client
matrix-client-cinny
matrix-client-element
matrix-client-fluffychat
matrix-client-hydrogen
matrix-client-schildichat
matrix-common-after
matrix-conduit
matrix-conduwuit
matrix-continuwuity
matrix-corporal
matrix-coturn
matrix-dendrite
matrix-dimension
matrix-dynamic-dns
matrix-element-call
matrix-ldap-registration-proxy
matrix-livekit-jwt-service
matrix-ma1sd
matrix-media-repo
matrix-pantalaimon
matrix-prometheus-nginxlog-exporter
matrix-prometheus-services-connect
matrix-rageshake
matrix-registration
matrix-sliding-sync
matrix-static-files
matrix-sygnal
matrix-synapse
matrix-synapse-admin
matrix-synapse-auto-compressor
matrix-synapse-reverse-proxy-companion
matrix-synapse-usage-exporter
matrix-user-creator
matrix-user-verification-service
matrix_playbook_migration
.editorconfig
.envrc
.gitattributes
.gitignore
.yamllint
CHANGELOG.md
CHANGELOG.md.license
LICENSE
Makefile
README.md
README.md.license
REUSE.toml
YEAR-IN-REVIEW.md
ansible.cfg
conf.py
flake.lock
flake.nix
jitsi_jvb.yml
justfile
requirements.yml
setup.yml
setup.yml.license
matrix-docker-ansible-deploy/roles/custom/matrix-bot-chatgpt/tasks/validate_config.yml
2025-03-05 13:30:50 +09:00

45 lines
2.2 KiB
YAML

# SPDX-FileCopyrightText: 2023 MDAD project contributors
# SPDX-FileCopyrightText: 2023 Slavi Pantaleev
# SPDX-FileCopyrightText: 2025 Suguru Hirahara
#
# SPDX-License-Identifier: AGPL-3.0-or-later
---
- name: Fail if required Chatgpt settings not defined
ansible.builtin.fail:
msg: >-
You need to define a required configuration setting (`{{ item.name }}`).
when: "item.when | bool and vars[item.name] == ''"
with_items:
- {'name': 'matrix_bot_chatgpt_openai_api_key', when: true}
- {'name': 'matrix_bot_chatgpt_matrix_bot_username', when: true}
- {'name': 'matrix_bot_chatgpt_container_network', when: true}
- {'name': 'matrix_bot_chatgpt_matrix_homeserver_url', when: true}
- name: Fail if OpenAI configuration not up-to-date.
ansible.builtin.fail:
msg: >-
Your configuration contains a varible that is no longer used.
Please change your configuration to remove the variable (`{{ item.name }}`).
when: "item.name in vars"
with_items:
- {'name': 'matrix_bot_chatgpt_openai_email'}
- {'name': 'matrix_bot_chatgpt_openai_password'}
- {'name': 'matrix_bot_chatgpt_openai_login_type'}
- name: (Deprecation) Catch and report renamed ChatGPT settings
ansible.builtin.fail:
msg: >-
Your configuration contains a variable, which now has a different name.
Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml).
when: "item.old in vars"
with_items:
- {'old': 'matrix_bot_chatgpt_docker_image', 'new': 'matrix_bot_chatgpt_container_image'}
- {'old': 'matrix_bot_chatgpt_docker_image_name_prefix', 'new': 'matrix_bot_chatgpt_container_image_name_prefix'}
- {'old': 'matrix_bot_chatgpt_docker_image_force_pull', 'new': 'matrix_bot_chatgpt_container_image_force_pull'}
- {'old': 'matrix_bot_chatgpt_docker_repo', 'new': 'matrix_bot_chatgpt_container_image_self_build_repo'}
- {'old': 'matrix_bot_chatgpt_docker_repo_version', 'new': 'matrix_bot_chatgpt_container_image_self_build_repo_version'}
- {'old': 'matrix_bot_chatgpt_docker_src_files_path', 'new': 'matrix_bot_chatgpt_container_src_path'}
- {'old': 'matrix_bot_chatgpt_container_image_name_prefix', 'new': 'matrix_bot_chatgpt_container_image_registry_prefix'}