fix2
This commit is contained in:
37
Makefile
37
Makefile
@@ -53,38 +53,23 @@ logs:
|
||||
docker compose logs --tail=100 -f $(c)
|
||||
|
||||
shell:
|
||||
docker compose exec ansible-molecule bash
|
||||
docker compose exec ansible bash
|
||||
|
||||
|
||||
# Создание новой роли с помощью Molecule
|
||||
create:
|
||||
docker compose run --rm ansible-molecule sh -c "ansible-galaxy role init $(ROLE_NAME) && cd $(ROLE_NAME) && molecule init scenario
|
||||
#docker compose run --rm ansible-molecule sh -c "molecule create"
|
||||
.PHONY: test lint vault deploy
|
||||
|
||||
# Запуск тестов Molecule
|
||||
test:
|
||||
docker compose run --rm ansible-molecule sh -c "molecule test"
|
||||
#docker compose run --rm ansible-molecule sh -c "molecule --help"
|
||||
test: ## Запуск тестов с molecule
|
||||
docker compose run --rm ansible bash -c "molecule test"
|
||||
|
||||
# Установка зависимостей из requirements.yml
|
||||
dependencies:
|
||||
docker compose run --rm ansible-molecule sh -c "ansible-galaxy role install -r /workspace/requirements.yml"
|
||||
lint: ## Проверка кода с ansible-lint
|
||||
docker compose run --rm ansible sh -c "ansible-lint roles/role"
|
||||
|
||||
# Шифрование файла с помощью Ansible Vault
|
||||
encrypt:
|
||||
docker compose run --rm ansible-molecule sh -c "ansible-vault encrypt --vault-password-file /workspace/$(VAULT_PASSWORD_FILE) /workspace/role/$(FILE)"
|
||||
vault: ## Шифрование/дешифрование с ansible-vault
|
||||
docker compose run --rm ansible sh -c "ansible-vault edit --vault-password-file vault-password.txt vars/secrets.yml"
|
||||
|
||||
# Расшифровка файла с помощью Ansible Vault
|
||||
decrypt:
|
||||
docker compose run --rm ansible-molecule sh -c "ansible-vault decrypt --vault-password-file /workspace/$(VAULT_PASSWORD_FILE) /workspace/role/$(FILE)"
|
||||
|
||||
# Просмотр зашифрованного файла
|
||||
view:
|
||||
docker compose run --rm ansible-molecule sh -c "ansible-vault view --vault-password-file /workspace/$(VAULT_PASSWORD_FILE) /workspace/role/$(FILE)"
|
||||
|
||||
# Запуск роли на реальных серверах
|
||||
deploy:
|
||||
docker compose run --rm ansible-molecule sh -c "ansible-playbook -i $(INVENTORY) $(PLAYBOOK) --vault-password-file /workspace/$(VAULT_PASSWORD_FILE)"
|
||||
deploy: test ## Деплой на реальные машины, если тест прошел успешно
|
||||
@echo "Deploying roles to production..."
|
||||
docker compose run --rm ansible sh -c "ansible-playbook -i inventory/production deploy.yml --vault-password-file vault-password.txt"
|
||||
|
||||
####################################################################################################
|
||||
# Работа с Git
|
||||
|
||||
Reference in New Issue
Block a user