Matrix Docker Ansible eploy
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

33 строки
1.1 KiB

  1. # SPDX-FileCopyrightText: 2022 Slavi Pantaleev
  2. #
  3. # SPDX-License-Identifier: AGPL-3.0-or-later
  4. .PHONY: roles lint
  5. VARS_DIR := inventory/host_vars/$(domain)
  6. VARS_FILE := inventory/host_vars/$(domain)/vars.yml
  7. HOSTS_FILE := inventory/hosts
  8. help: ## Show this help.
  9. @grep -F -h "##" $(MAKEFILE_LIST) | grep -v grep | sed -e 's/\\$$//' | sed -e 's/##//'
  10. inventory: ## Initialize inventory files
  11. @mkdir -p "$(VARS_DIR)"
  12. @cp examples/vars.yml "$(VARS_FILE)"
  13. @cp examples/hosts inventory/hosts
  14. @sed -i 's/^matrix_domain:.*/matrix_domain: $(domain)/' "$(VARS_FILE)"
  15. @PASSWORD=`openssl rand -base64 64 | head -c 64`; \
  16. sed -i "s#^matrix_homeserver_generic_secret_key:.*#matrix_homeserver_generic_secret_key: '$$PASSWORD'#" "$(VARS_FILE)"
  17. @sed -i 's/^matrix\.example\.com/$(domain)/' "$(HOSTS_FILE)"
  18. @sed -i 's/ansible_host=<[^>]\+>/ansible_host=$(ip)/' "$(HOSTS_FILE)"
  19. @echo "Check and configure your files at:"
  20. @echo $(VARS_FILE)
  21. @echo $(HOSTS_FILE)
  22. roles: ## Pull roles
  23. rm -rf roles/galaxy
  24. ansible-galaxy install -r requirements.yml -p roles/galaxy/ --force
  25. lint: ## Runs ansible-lint against all roles in the playbook
  26. ansible-lint roles/custom