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) |
Scott Baker | 8ed63bb | 2016-07-07 14:20:08 -0700 | [diff] [blame^] | 13 | sudo ./check_docker_version.sh |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 14 | |
| 15 | admin-openrc: |
| 16 | sudo cat /root/setup/admin-openrc.sh > $(SETUPDIR)/admin-openrc.sh |
| 17 | sudo cat /root/setup/settings > $(SETUPDIR)/controller_settings |
| 18 | echo 'CONTROLLER_FLAT_LAN_IP=$(MYFLATLANIP)' >> $(SETUPDIR)/controller_settings |
| 19 | |
| 20 | flat_name: |
| 21 | bash -c "source $(SETUPDIR)/admin-openrc.sh ; neutron net-list" |grep flat|awk '{printf "%s",$$4}' > $(SETUPDIR)/flat_net_name |
| 22 | [ -s $(SETUPDIR)/flat_net_name ] # throw error if flat_net_name is empty |
| 23 | |
| 24 | nodes_yaml: |
| 25 | export SETUPDIR=$(SETUPDIR); bash ./make-nodes-yaml.sh |
| 26 | |
| 27 | ceilometer_url: |
| 28 | echo http://`hostname -i`/xosmetering/ > $(SETUPDIR)/ceilometer_url |
| 29 | |
| 30 | public_key: ~/.ssh/id_rsa.pub |
| 31 | cp ~/.ssh/id_rsa.pub $(SETUPDIR) |
| 32 | |
| 33 | private_key: ~/.ssh/id_rsa |
| 34 | cp ~/.ssh/id_rsa $(SETUPDIR) |
| 35 | |
| 36 | ~/.ssh/id_rsa.pub: |
| 37 | cat /dev/zero | ssh-keygen -q -N "" |
| 38 | |
| 39 | other_keys: public_key private_key |
| 40 | sudo cat /root/setup/id_rsa > $(SETUPDIR)/node_key |
| 41 | sudo cat /root/setup/id_rsa.pub > $(SETUPDIR)/node_key.pub |
| 42 | sudo cp $(SETUPDIR)/id_rsa.pub $(SETUPDIR)/padmin_public_key |