Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 1 | MYFLATLANIF:=$(shell netstat -i |grep "flat"|awk '{print $$1}' ) |
| 2 | MYFLATLANIP:=$(shell ifconfig $(MYFLATLANIF) | grep "inet addr" | awk -F: '{print $$2}' | awk '{print $$1}' ) |
| 3 | SETUPDIR:=../setup |
| 4 | |
| 5 | all: prereqs admin-openrc flat_name nodes_yaml public_key private_key ceilometer_url node_key |
| 6 | |
| 7 | prereqs: |
| 8 | make -f Makefile.prereqs |
| 9 | mkdir -p $(SETUPDIR) |
| 10 | |
| 11 | admin-openrc: |
| 12 | sudo cat /root/setup/admin-openrc.sh > $(SETUPDIR)/admin-openrc.sh |
| 13 | sudo cat /root/setup/settings > $(SETUPDIR)/controller_settings |
| 14 | echo 'CONTROLLER_FLAT_LAN_IP=$(MYFLATLANIP)' >> $(SETUPDIR)/controller_settings |
| 15 | |
| 16 | flat_name: |
| 17 | sudo bash -c "source /root/setup/admin-openrc.sh ; neutron net-list" |grep flat|awk '{printf "%s",$$4}' > $(SETUPDIR)/flat_net_name |
| 18 | [ -s $(SETUPDIR)/flat_net_name ] # throw error if flat_net_name is empty |
| 19 | |
| 20 | nodes_yaml: |
| 21 | bash ./make-nodes-yaml.sh > $(SETUPDIR)/nodes.yaml |
| 22 | |
| 23 | ceilometer_url: |
| 24 | echo http://`hostname -i`/xosmetering/ > $(SETUPDIR)/ceilometer_url |
| 25 | |
| 26 | public_key: ~/.ssh/id_rsa.pub |
| 27 | cp ~/.ssh/id_rsa.pub $(SETUPDIR) |
| 28 | |
| 29 | private_key: ~/.ssh/id_rsa |
| 30 | cp ~/.ssh/id_rsa $(SETUPDIR) |
| 31 | |
| 32 | ~/.ssh/id_rsa.pub: |
| 33 | cat /dev/zero | ssh-keygen -q -N "" |
| 34 | |
| 35 | node_key: |
| 36 | sudo cat /root/setup/id_rsa > $(SETUPDIR)/node_key |
| 37 | sudo cat /root/setup/id_rsa.pub > $(SETUPDIR)/node_key.pub |
| 38 | |
| 39 | images: |
| 40 | source admin-openrc.sh; glance image-show trusty-server-multi-nic || glance image-create --name trusty-server-multi-nic --disk-format qcow2 --file /proj/xos-PG0/acb/images/trusty-server-multi-nic.img --container-format bare |