blob: 7ab8a54828b7e7c55a71ff873c65fd348cf567c3 [file] [log] [blame]
Scott Baker50421662016-06-27 22:09:48 -07001MYFLATLANIF:=$(shell netstat -i |grep "flat"|awk '{print $$1}' )
2ifndef MYFLATLANIF
3$(error MYFLATLANIF is empty)
4endif
5MYFLATLANIP:=$(shell ifconfig $(MYFLATLANIF) | grep "inet addr" | awk -F: '{print $$2}' | awk '{print $$1}' )
6SETUPDIR:=../setup
7
8all: prereqs admin-openrc flat_name nodes_yaml public_key private_key ceilometer_url other_keys
9
10prereqs:
11 make -f Makefile.prereqs
12 mkdir -p $(SETUPDIR)
13
14admin-openrc:
15 sudo cat /root/setup/admin-openrc.sh > $(SETUPDIR)/admin-openrc.sh
16 sudo cat /root/setup/settings > $(SETUPDIR)/controller_settings
17 echo 'CONTROLLER_FLAT_LAN_IP=$(MYFLATLANIP)' >> $(SETUPDIR)/controller_settings
18
19flat_name:
20 bash -c "source $(SETUPDIR)/admin-openrc.sh ; neutron net-list" |grep flat|awk '{printf "%s",$$4}' > $(SETUPDIR)/flat_net_name
21 [ -s $(SETUPDIR)/flat_net_name ] # throw error if flat_net_name is empty
22
23nodes_yaml:
24 export SETUPDIR=$(SETUPDIR); bash ./make-nodes-yaml.sh
25
26ceilometer_url:
27 echo http://`hostname -i`/xosmetering/ > $(SETUPDIR)/ceilometer_url
28
29public_key: ~/.ssh/id_rsa.pub
30 cp ~/.ssh/id_rsa.pub $(SETUPDIR)
31
32private_key: ~/.ssh/id_rsa
33 cp ~/.ssh/id_rsa $(SETUPDIR)
34
35~/.ssh/id_rsa.pub:
36 cat /dev/zero | ssh-keygen -q -N ""
37
38other_keys: public_key private_key
39 sudo cat /root/setup/id_rsa > $(SETUPDIR)/node_key
40 sudo cat /root/setup/id_rsa.pub > $(SETUPDIR)/node_key.pub
41 sudo cp $(SETUPDIR)/id_rsa.pub $(SETUPDIR)/padmin_public_key