-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
54 lines (42 loc) · 2.04 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
#### Variables ####
export ROOT_DIR ?= $(PWD)
export GNBSIM_ROOT_DIR ?= $(ROOT_DIR)
export ANSIBLE_NAME ?= ansible-gnbsim
export HOSTS_INI_FILE ?= hosts.ini
export EXTRA_VARS ?= ""
#### Start Ansible docker ####
gnbsim-ansible:
export ANSIBLE_NAME=$(ANSIBLE_NAME); \
sh $(GNBSIM_ROOT_DIR)/scripts/ansible ssh-agent bash
#### a. Debugging ####
gnbsim-pingall:
ansible-playbook -i $(HOSTS_INI_FILE) $(GNBSIM_ROOT_DIR)/pingall.yml \
--extra-vars "ROOT_DIR=$(ROOT_DIR)" --extra-vars $(EXTRA_VARS)
#### b. Provision docker ####
gnbsim-docker-install:
ansible-playbook -i $(HOSTS_INI_FILE) $(GNBSIM_ROOT_DIR)/docker.yml --tags install \
--extra-vars "ROOT_DIR=$(ROOT_DIR)" --extra-vars $(EXTRA_VARS)
gnbsim-docker-uninstall:
ansible-playbook -i $(HOSTS_INI_FILE) $(GNBSIM_ROOT_DIR)/docker.yml --tags uninstall \
--extra-vars "ROOT_DIR=$(ROOT_DIR)" --extra-vars $(EXTRA_VARS)
gnbsim-docker-router-install:
ansible-playbook -i $(HOSTS_INI_FILE) $(GNBSIM_ROOT_DIR)/router.yml --tags install \
--extra-vars "ROOT_DIR=$(ROOT_DIR)" --extra-vars $(EXTRA_VARS)
gnbsim-docker-router-uninstall:
ansible-playbook -i $(HOSTS_INI_FILE) $(GNBSIM_ROOT_DIR)/router.yml --tags uninstall \
--extra-vars "ROOT_DIR=$(ROOT_DIR)" --extra-vars $(EXTRA_VARS)
gnbsim-docker-start:
ansible-playbook -i $(HOSTS_INI_FILE) $(GNBSIM_ROOT_DIR)/docker.yml --tags start \
--extra-vars "ROOT_DIR=$(ROOT_DIR)" --extra-vars $(EXTRA_VARS)
gnbsim-docker-stop:
ansible-playbook -i $(HOSTS_INI_FILE) $(GNBSIM_ROOT_DIR)/docker.yml --tags stop \
--extra-vars "ROOT_DIR=$(ROOT_DIR)" --extra-vars $(EXTRA_VARS)
#### c. Provision gnbsim ####
gnbsim-simulator-run:
ansible-playbook -i $(HOSTS_INI_FILE) \
$(GNBSIM_ROOT_DIR)/simulator.yml --tags start --extra-vars \
"ROOT_DIR=$(ROOT_DIR)" --extra-vars $(EXTRA_VARS)
# run gnbsim-docker-install before running setup
gnbsim-install: gnbsim-docker-install gnbsim-docker-router-install gnbsim-docker-start
gnbsim-uninstall: gnbsim-docker-stop gnbsim-docker-router-uninstall gnbsim-docker-uninstall
gnbsim-reset: gnbsim-docker-stop gnbsim-docker-start