forked from shiftstack/dev-install
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
89 lines (70 loc) · 2.68 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# The installation target used when initializing the local ansible inventory.
# N.B. This is *only* used when initializing the local ansible inventory file.
# Specifically it is not used if the inventory file already exists.
#
# It is recommended to run:
# make config host=<myhost>
#
SHELL=/bin/bash
host ?= my_osp_host
user ?= root
ansible_args ?=
overrides ?= local-overrides.yaml
ANSIBLE_CMD=ANSIBLE_FORCE_COLOR=true ansible-playbook $(ansible_args) -i inventory.yaml -e @$(overrides)
usage:
@echo 'Usage:'
@echo
@echo 'make config host=<standalone host>'
@echo 'make osp_full'
@echo
@echo 'Individual install phase targets:'
@echo ' local_requirements: Install Ansible requirements required to run dev-install'
@echo ' prepare_host: Host configuration required before installing standalone, including rhos-release'
@echo ' network: Host networking configuration required before installing standalone'
@echo ' install_stack: Install TripleO standalone'
@echo ' prepare_stack: Configure defaults in OSP and create shiftstack user'
@echo
@echo 'Utility targets:'
@echo ' local_os_client: Configure local clouds.yaml to use standalone cloud'
@echo ' prepare_stack_testconfig: Download cirros image and create a test network, router and security group'
#
# Targets which initialize local state
#
.PHONY: config
config: inventory.yaml $(overrides)
inventory.yaml:
echo -e "all:\n hosts:\n standalone:\n ansible_host: $(host)\n ansible_user: $(user)\n" > $@
$(overrides):
echo -e "# Override default variables by putting them in this file\nstandalone_host: $(host)" > $(overrides)
#
# Deploy targets
#
.PHONY: osp_full
osp_full: local_requirements prepare_host network install_stack prepare_stack local_os_client
.PHONY: local_requirements
local_requirements: inventory.yaml $(overrides)
$(ANSIBLE_CMD) playbooks/local_requirements.yaml
.PHONY: prepare_host
prepare_host: inventory.yaml $(overrides)
$(ANSIBLE_CMD) playbooks/prepare_host.yaml
.PHONY: network
network: inventory.yaml $(overrides)
$(ANSIBLE_CMD) playbooks/network.yaml
.PHONY: install_stack
install_stack: inventory.yaml $(overrides)
$(ANSIBLE_CMD) playbooks/install_stack.yaml
.PHONY: prepare_stack
prepare_stack: inventory.yaml $(overrides)
$(ANSIBLE_CMD) playbooks/prepare_stack.yaml
.PHONY: prepare_stack_testconfig
prepare_stack_testconfig: inventory.yaml $(overrides)
$(ANSIBLE_CMD) playbooks/prepare_stack_testconfig.yaml
.PHONY: local_os_client
local_os_client: inventory.yaml $(overrides)
$(ANSIBLE_CMD) playbooks/local_os_client.yaml
.PHONY: certs
certs: $(overrides)
$(ANSIBLE_CMD) playbooks/certs.yaml
.PHONY: destroy
destroy: inventory.yaml $(overrides)
$(ANSIBLE_CMD) playbooks/destroy.yaml