Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 1 | MYFLATLANIF:=$(shell netstat -i |grep "flat"|awk '{print $$1}' ) |
| 2 | ifndef MYFLATLANIF |
| 3 | $(error MYFLATLANIF is empty) |
| 4 | endif |
| 5 | MYFLATLANIP:=$(shell ifconfig $(MYFLATLANIF) | grep "inet addr" | awk -F: '{print $$2}' | awk '{print $$1}' ) |
| 6 | SETUPDIR:=../setup |
| 7 | |
| 8 | all: prereqs admin-openrc flat_name nodes_yaml public_key private_key ceilometer_url other_keys |
| 9 | |
| 10 | prereqs: |
| 11 | make -f Makefile.prereqs |
| 12 | mkdir -p $(SETUPDIR) |
| 13 | |
| 14 | admin-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 | |
| 19 | flat_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 | |
| 23 | nodes_yaml: |
| 24 | export SETUPDIR=$(SETUPDIR); bash ./make-nodes-yaml.sh |
| 25 | |
| 26 | ceilometer_url: |
| 27 | echo http://`hostname -i`/xosmetering/ > $(SETUPDIR)/ceilometer_url |
| 28 | |
| 29 | public_key: ~/.ssh/id_rsa.pub |
| 30 | cp ~/.ssh/id_rsa.pub $(SETUPDIR) |
| 31 | |
| 32 | private_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 | |
| 38 | other_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 |