diff --git a/Makefile b/Makefile index c2b2667..bc856a8 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,30 @@ -venv: - pip3 install wheel - pip3 install -r requirements.txt +VENV_DIR := .venv +SHELL := /usr/bin/env bash +.DEFAULT_GOAL := help -venv-upgrade: - pip3 install -U -r requirements.txt +help: + @grep -E '^[a-zA-Z1-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) \ + | awk 'BEGIN { FS = ":.*?## " }; { printf "\033[36m%-30s\033[0m %s\n", $$1, $$2 }' -test: - molecule test +install: ## Install all necessary tools + $(MAKE) \ + venv \ + install-pip-packages + @echo -e "\n--> You should now activate the python3 venv with:" + @echo -e "source $(VENV_DIR)/bin/activate" + +venv: ## Create python3 venv if it does not exists + [[ -d $(VENV_DIR) ]] || $(shell command -v python3) -m venv $(VENV_DIR) + +install-pip-packages: ## Install python3 requirements + $(info --> Install requirements via `pip3`) + @( \ + source $(VENV_DIR)/bin/activate; \ + pip3 install -r requirements.txt; \ + ) + +upgrade-pip-packages: ## Upgrade python3 requirements + $(shell command -v pip3) -U -r requirements.txt + +clean: ## Clean venv + [[ ! -d $(VENV_DIR) ]] || rm -rf $(VENV_DIR) diff --git a/requirements.txt b/requirements.txt index fb70362..e3ba49f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,7 @@ ansible==2.9.* -docker +#ansible==2.10.* mitogen -molecule==3.1.* +#https://github.com/mitogen-hq/mitogen/archive/v0.3.0-rc.0.tar.gz +molecule==3.2.* molecule-docker pytest-testinfra diff --git a/tasks/backup.yml b/tasks/backup.yml index db9cbeb..1ef656c 100644 --- a/tasks/backup.yml +++ b/tasks/backup.yml @@ -24,7 +24,7 @@ - name: Deploy crontab file cron: - name: "Dump MariaBD databases" + name: "Dump MariaDB databases" minute: "{{ mariadb_backup_db_cron_min }}" hour: "{{ mariadb_backup_db_cron_hour }}" job: "/usr/local/bin/mariadb_dump_db.sh \