-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
40 lines (31 loc) · 1002 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
SHELL := /bin/bash
.PHONY: help
help: ## Show the help.
@echo "Usage: make <target>"
@echo ""
@echo "Targets:"
@fgrep "##" Makefile | fgrep -v fgrep
.PHONY: python
python: ## Install python modules
@apt install python3-pip python3-venv
.PHONY: venv
venv:
python -m venv .venv
@echo "!!! Please run 'source .venv/bin/activate' to enable the environment !!!"
.PHONY: config
config:
@export ANSIBLE_CONFIG=$(pwd)/ansible.cfg
.PHONY: install
install: ## upgrade pip and install requirements in ./requirements.txt
@pip install --upgrade pip
@pip install -r requirements.txt
.PHONY: run
run: ## run playbook
@ansible-playbook playbook.yaml
.PHONY: ssl
ssl: ## Create SSL certificate in ./config_nc_web/files/ssl/
@openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout $(pwd)/config_nc_web/files/ssl/ollemg.br.key -out $(pwd)/config_nc_web/files/ssl/ollemg.br.crt
.PHONY: lint
lint: ## lint playbook
@ansible-playbook --syntax-check playbook.yaml
@ansible-lint playbook.yaml