You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
930 B
33 lines
930 B
CLUSTER ?= sample |
|
SSH_USER ?= $(USER) |
|
SSH_KEY ?= $(USER)/.ssh/id_rsa |
|
|
|
PROVISION_USER ?= provision |
|
VAULT_FILE ?= .ansible_vault |
|
|
|
ANSIBLE := ansible-playbook --user $(SSH_USER) --private-key $(SSH_KEY) --vault-password-file $(VAULT_FILE) --become --extra-vars "deploy_cluster=$(CLUSTER) provision_user=$(PROVISION_USER)" |
|
ANSIBLE_CFG := ansible.cfg |
|
HOSTS := inventory/$(CLUSTER)/hosts.ini |
|
|
|
help: ## Display this help. |
|
@awk 'BEGIN { \ |
|
FS = ":.*##"; \ |
|
printf "\nUsage:\n make \033[36m<target>\033[0m\n\nTargets:\n" \ |
|
} \ |
|
/^[a-zA-Z_-]+:.*?##/ { \ |
|
printf " \033[36m%-10s\033[0m %s\n", $$1, $$2 \ |
|
} \ |
|
END { \ |
|
print \ |
|
}' \ |
|
$(MAKEFILE_LIST) |
|
|
|
|
|
install: provision ## Provision Greenplum cluster |
|
|
|
provision: ## Provision Greenplum cluster |
|
ANSIBLE_CONFIG=$(ANSIBLE_CFG) $(ANSIBLE) -i $(HOSTS) site.yml |
|
|
|
users: ## Create extra users |
|
ANSIBLE_CONFIG=$(ANSIBLE_CFG) $(ANSIBLE) -i $(HOSTS) add-users.yml |
|
|
|
|