-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
32 lines (25 loc) · 994 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
build:
docker build -t opstree/ansible:1.0 .
docker build -t opstree/ansibledocker:1.0 -f Dockerfile.controlserver .
create-network:
@docker network create opstree || true > /dev/null
run-vm:
echo "Creating VM $(VM_NAME)"
@docker rm -f $(VM_NAME) || true > /dev/null
@docker run -itd -l vm --name $(VM_NAME) --rm --net opstree opstree/ansible:1.0
@docker exec -it $(VM_NAME) bash -c "/etc/init.d/ssh start"
terminate-vm:
echo "Terminating VM $(VM_NAME)"
@docker rm -f $(VM_NAME) || true
run-controlserver:
@docker rm -f controlserver || true > /dev/null
@docker run -itd --name controlserver --rm --net opstree -v ${PWD}:/src -v /var/run/docker.sock:/var/run/docker.sock --privileged opstree/ansibledocker:1.0
list-vm:
echo "Listing VM's"
@docker ps --filter "label=vm" --format "{{.Names}}"
wait:
read -p "Press enter to continue...."
clear
run-ping:
echo "Validating connection to VM's"
docker exec -it controlserver bash -c "ansible -i /src/$(INVENTORY) all -m ping"