summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Giles <mark.giles@oracle.com>2018-06-08 12:53:01 -0400
committerMark Giles <mark.giles@oracle.com>2018-06-08 12:53:01 -0400
commit680c288b367761b2dfa241482cec715a16a99621 (patch)
tree46a8c3d6ca2bf0a9aa5e6deb054beb3472c739e5
parente88b9a7ad491e0c1b4575d1eb86d37e4e7cf55e7 (diff)
Set up the kolla-cli and inventory for the vagrant dev environment
When bootstrapping the vagrant dev environment run commands on the operator node to set up the kolla-cli, and to set up the host inventory as appropriate for either multinode or aio deployment. Change-Id: I7765d5302329919dce6317d78b84af1c7bf572b3
Notes
Notes (review): Code-Review+1: Borne Mace <borne.mace@oracle.com> Code-Review+2: Paul Bourke (pbourke) <paul.bourke@oracle.com> Code-Review+1: Chason Chan <chason.chan@foxmail.com> Code-Review+2: Jeffrey Zhang <jeffrey.zhang@99cloud.net> Workflow+1: Jeffrey Zhang <jeffrey.zhang@99cloud.net> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Thu, 14 Jun 2018 06:26:41 +0000 Reviewed-on: https://review.openstack.org/573788 Project: openstack/kolla-ansible Branch: refs/heads/master
-rw-r--r--contrib/dev/vagrant/Vagrantfile4
-rw-r--r--contrib/dev/vagrant/bootstrap.sh57
2 files changed, 53 insertions, 8 deletions
diff --git a/contrib/dev/vagrant/Vagrantfile b/contrib/dev/vagrant/Vagrantfile
index 5f852ac..1956ce0 100644
--- a/contrib/dev/vagrant/Vagrantfile
+++ b/contrib/dev/vagrant/Vagrantfile
@@ -232,7 +232,7 @@ Vagrant.configure(2) do |config|
232 # The operator controls the deployment 232 # The operator controls the deployment
233 config.vm.define "operator", primary: true do |admin| 233 config.vm.define "operator", primary: true do |admin|
234 admin.vm.hostname = "operator.local" 234 admin.vm.hostname = "operator.local"
235 admin.vm.provision :shell, path: PROVISION_SCRIPT, args: "operator #{MULTINODE ? 'multinode' : 'aio'} #{kolla_path} #{kolla_ansible_path} #{kolla_cli_path}" 235 admin.vm.provision :shell, path: PROVISION_SCRIPT, args: "operator #{MULTINODE ? 'multinode' : 'aio'} #{kolla_path} #{kolla_ansible_path} #{kolla_cli_path} #{NUMBER_OF_COMPUTE_NODES} #{NUMBER_OF_STORAGE_NODES} #{NUMBER_OF_NETWORK_NODES} #{NUMBER_OF_CONTROL_NODES}"
236 admin.vm.synced_folder kolla_ansible_repo_path, kolla_ansible_path, create:"True", type: get_default(:sync_method) 236 admin.vm.synced_folder kolla_ansible_repo_path, kolla_ansible_path, create:"True", type: get_default(:sync_method)
237 admin.vm.synced_folder kolla_repo_path, kolla_path, create:"True", type: get_default(:sync_method) 237 admin.vm.synced_folder kolla_repo_path, kolla_path, create:"True", type: get_default(:sync_method)
238 admin.vm.synced_folder kolla_cli_repo_path, kolla_cli_path, create:"True", type: get_default(:sync_method) 238 admin.vm.synced_folder kolla_cli_repo_path, kolla_cli_path, create:"True", type: get_default(:sync_method)
@@ -256,7 +256,7 @@ Vagrant.configure(2) do |config|
256 hostname = "#{node_type}0#{i}" 256 hostname = "#{node_type}0#{i}"
257 config.vm.define hostname do |node| 257 config.vm.define hostname do |node|
258 node.vm.hostname = "#{hostname}.local" 258 node.vm.hostname = "#{hostname}.local"
259 node.vm.provision :shell, path: PROVISION_SCRIPT, args: "#{hostname} multinode #{kolla_path} #{kolla_ansible_path} #{kolla_cli_path}" 259 node.vm.provision :shell, path: PROVISION_SCRIPT, args: "#{hostname} multinode #{kolla_path} #{kolla_ansible_path} #{kolla_cli_path} #{NUMBER_OF_COMPUTE_NODES} #{NUMBER_OF_STORAGE_NODES} #{NUMBER_OF_NETWORK_NODES} #{NUMBER_OF_CONTROL_NODES}"
260 node.vm.synced_folder File.join(vagrant_dir, 'storage', node_type), "/data/host", create:"True", type: get_default(:sync_method) 260 node.vm.synced_folder File.join(vagrant_dir, 'storage', node_type), "/data/host", create:"True", type: get_default(:sync_method)
261 node.vm.synced_folder File.join(vagrant_dir, 'storage', 'shared'), "/data/shared", create:"True", type: get_default(:sync_method) 261 node.vm.synced_folder File.join(vagrant_dir, 'storage', 'shared'), "/data/shared", create:"True", type: get_default(:sync_method)
262 node.vm.synced_folder ".", vagrant_shared_folder, disabled: true 262 node.vm.synced_folder ".", vagrant_shared_folder, disabled: true
diff --git a/contrib/dev/vagrant/bootstrap.sh b/contrib/dev/vagrant/bootstrap.sh
index 087b020..a492263 100644
--- a/contrib/dev/vagrant/bootstrap.sh
+++ b/contrib/dev/vagrant/bootstrap.sh
@@ -11,6 +11,10 @@ MODE=$2
11KOLLA_PATH=$3 11KOLLA_PATH=$3
12KOLLA_ANSIBLE_PATH=$4 12KOLLA_ANSIBLE_PATH=$4
13KOLLA_CLI_PATH=$5 13KOLLA_CLI_PATH=$5
14NUMBER_OF_COMPUTE_NODES=$6
15NUMBER_OF_STORAGE_NODES=$7
16NUMBER_OF_NETWORK_NODES=$8
17NUMBER_OF_CONTROL_NODES=$9
14 18
15export http_proxy= 19export http_proxy=
16export https_proxy= 20export https_proxy=
@@ -151,14 +155,54 @@ function configure_kolla {
151 # Use local docker registry 155 # Use local docker registry
152 sed -i -r "s,^[# ]*namespace *=.+$,namespace = ${REGISTRY}/lokolla," /etc/kolla/kolla-build.conf 156 sed -i -r "s,^[# ]*namespace *=.+$,namespace = ${REGISTRY}/lokolla," /etc/kolla/kolla-build.conf
153 sed -i -r "s,^[# ]*push *=.+$,push = True," /etc/kolla/kolla-build.conf 157 sed -i -r "s,^[# ]*push *=.+$,push = True," /etc/kolla/kolla-build.conf
154 sed -i -r "s,^[# ]*docker_registry:.+$,docker_registry: \"${REGISTRY}\"," /etc/kolla/globals.yml 158 kolla-cli property set docker_registry ${REGISTRY}
155 sed -i -r "s,^[# ]*docker_namespace:.+$,docker_namespace: \"lokolla\"," /etc/kolla/globals.yml 159 kolla-cli property set docker_namespace lokolla
156 sed -i -r "s,^[# ]*docker_insecure_registry:.+$,docker_insecure_registry: \"True\"," /etc/kolla/globals.yml 160 kolla-cli property set docker_insecure_registry True
157 # Set network interfaces 161 # Set network interfaces
158 sed -i -r "s,^[# ]*network_interface:.+$,network_interface: \"eth1\"," /etc/kolla/globals.yml 162 kolla-cli property set network_interface eth1
159 sed -i -r "s,^[# ]*neutron_external_interface:.+$,neutron_external_interface: \"eth2\"," /etc/kolla/globals.yml 163 kolla-cli property set neutron_external_interface eth2
160 # Set VIP address to be on the vagrant private network 164 # Set VIP address to be on the vagrant private network
161 sed -i -r "s,^[# ]*kolla_internal_vip_address:.+$,kolla_internal_vip_address: \"172.28.128.254\"," /etc/kolla/globals.yml 165 kolla-cli property set kolla_internal_vip_address 172.28.128.254
166}
167
168function configure_kolla_cli {
169 # Run the CLI setup script
170 pushd ${KOLLA_CLI_PATH}
171 python ./cli_setup.py
172 popd
173
174 # Set up the kolla-cli inventory
175 if [ "$MODE" == 'aio' ]; then
176 kolla-cli setdeploy local
177 kolla-cli host add localhost
178 for group in control deployment monitoring network storage; do
179 kolla-cli group addhost $group localhost
180 done
181 else
182 for node_num in $(seq 1 ${NUMBER_OF_COMPUTE_NODES}); do
183 node_name="compute0${node_num}"
184 kolla-cli host add $node_name
185 kolla-cli group addhost external-compute $node_name
186 done
187
188 for node_num in $(seq 1 ${NUMBER_OF_STORAGE_NODES}); do
189 node_name="storage0${node_num}"
190 kolla-cli host add $node_name
191 kolla-cli group addhost storage $node_name
192 done
193
194 for node_num in $(seq 1 ${NUMBER_OF_NETWORK_NODES}); do
195 node_name="network0${node_num}"
196 kolla-cli host add $node_name
197 kolla-cli group addhost network $node_name
198 done
199
200 for node_num in $(seq 1 ${NUMBER_OF_CONTROL_NODES}); do
201 node_name="control0${node_num}"
202 kolla-cli host add $node_name
203 kolla-cli group addhost control $node_name
204 done
205 fi
162} 206}
163 207
164# Configure the operator node and install some additional packages. 208# Configure the operator node and install some additional packages.
@@ -192,6 +236,7 @@ function configure_operator {
192 mkdir -p /usr/share/kolla 236 mkdir -p /usr/share/kolla
193 chown -R vagrant: /etc/kolla /usr/share/kolla 237 chown -R vagrant: /etc/kolla /usr/share/kolla
194 238
239 configure_kolla_cli
195 configure_kolla 240 configure_kolla
196 241
197 # Make sure Ansible uses scp. 242 # Make sure Ansible uses scp.