aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rw-r--r--contrib/bash-completion/kolla-ansible21
-rwxr-xr-xcontrib/demos/heat/launch21
-rw-r--r--contrib/dev/vagrant/Vagrantfile28
-rw-r--r--contrib/dev/vagrant/Vagrantfile.custom.example9
-rw-r--r--contrib/dev/vagrant/bootstrap.sh7
5 files changed, 68 insertions, 18 deletions
diff --git a/contrib/bash-completion/kolla-ansible b/contrib/bash-completion/kolla-ansible
new file mode 100644
index 000000000..56b8ea8ff
--- /dev/null
+++ b/contrib/bash-completion/kolla-ansible
@@ -0,0 +1,21 @@
+_kolla_ansible() {
+ local cur prev opts
+
+ COMPREPLY=()
+
+ cur="${COMP_WORDS[COMP_CWORD]}"
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
+ kolla_ansible_opts="$(kolla-ansible bash-completion)"
+ kolla_ansible_flags="$(echo ${kolla_ansible_opts} | sed 's/ [^-][a-z0-9_-]*//g' )"
+ kolla_ansible_actions="$(echo ${kolla_ansible_opts} | sed 's/--[a-z0-9-]*//g' | sed 's/ -[a-z]//g' )"
+
+ if [[ ${cur} == -* ]] ; then
+ COMPREPLY=( $(compgen -W "${kolla_ansible_flags}" -- ${cur}) )
+ return 0
+ else
+ COMPREPLY=( $(compgen -W "${kolla_ansible_actions}" -- ${cur}) )
+ return 0
+ fi
+}
+
+complete -F _kolla_ansible -A file kolla-ansible
diff --git a/contrib/demos/heat/launch b/contrib/demos/heat/launch
index 768b69eb0..9924f3fd9 100755
--- a/contrib/demos/heat/launch
+++ b/contrib/demos/heat/launch
@@ -1,11 +1,18 @@
+#!/bin/bash
+
VM_COUNT=3
IMAGE_FLAVOR=m1.small
-PUBLIC_NET_ID=$(neutron net-list | grep public | awk '{print $2}')
-DEMO_NET_ID=$(neutron net-list | grep demo | awk '{print $2}')
-DEMO_SUBNET_ID=$(neutron net-list | grep demo | awk '{print $6}')
+PUBLIC_NET_ID=$(openstack network show public1 | awk '/ id /{print $4}')
+DEMO_NET_ID=$(openstack network show demo-net | awk '/ id /{print $4}')
+DEMO_SUBNET_ID=$(openstack subnet show demo-subnet | awk '/ id /{print $4}')
-echo Public net id is $PUBLIC_NET_ID
-echo Demo net id is $DEMO_NET_ID
-echo Demo subnet id is $DEMO_SUBNET_ID
+echo "Public net id is $PUBLIC_NET_ID"
+echo "Demo net id is $DEMO_NET_ID"
+echo "Demo subnet id is $DEMO_SUBNET_ID"
-heat stack-create steak --template-file steak-rg.yaml --parameters="vm_count=$VM_COUNT;image_flavor=$IMAGE_FLAVOR;public_net_id=$PUBLIC_NET_ID;demo_net_id=$DEMO_NET_ID;demo_subnet_id=$DEMO_SUBNET_ID"
+openstack stack create --parameter vm_count=$VM_COUNT \
+ --parameter image_flavor=$IMAGE_FLAVOR \
+ --parameter public_net_id=$PUBLIC_NET_ID \
+ --parameter demo_net_id=$DEMO_NET_ID \
+ --parameter demo_subnet_id=$DEMO_SUBNET_ID \
+ -t steak-rg.yaml steak
diff --git a/contrib/dev/vagrant/Vagrantfile b/contrib/dev/vagrant/Vagrantfile
index a667aa086..3088e2126 100644
--- a/contrib/dev/vagrant/Vagrantfile
+++ b/contrib/dev/vagrant/Vagrantfile
@@ -15,6 +15,11 @@ end
vagrant_dir = File.expand_path(File.dirname(__FILE__))
+# get kolla and kolla-ansibe repos path relative to current directory
+# they will be used by the bootstrap script to configure the nodes
+kolla_ansible_repo_path = File.expand_path(File.join(vagrant_dir, '..', '..', '..'))
+kolla_repo_path = File.expand_path(File.join(vagrant_dir, '..', '..', '..', '..', 'kolla'))
+
# Vagrantfile.custom contains user customization for the Vagrantfile
# You shouldn't have to edit the Vagrantfile, ever.
if File.exists?(File.join(vagrant_dir, 'Vagrantfile.custom'))
@@ -42,7 +47,8 @@ PROVIDER_DEFAULTS ||= {
bridge_interface: "virbr0",
vagrant_shared_folder: "/home/vagrant/sync",
sync_method: "nfs",
- kolla_path: "/home/vagrant/kolla"
+ kolla_path: "/home/vagrant/kolla",
+ kolla_ansible_path: "/home/vagrant/kolla-ansible"
}
},
virtualbox: {
@@ -51,14 +57,16 @@ PROVIDER_DEFAULTS ||= {
bridge_interface: "wlp3s0b1",
vagrant_shared_folder: "/home/vagrant/sync",
sync_method: "virtualbox",
- kolla_path: "/home/vagrant/kolla"
+ kolla_path: "/home/vagrant/kolla",
+ kolla_ansible_path: "/home/vagrant/kolla-ansible"
},
ubuntu: {
base_image: "ubuntu/wily64",
bridge_interface: "wlp3s0b1",
vagrant_shared_folder: "/home/vagrant/sync",
sync_method: "virtualbox",
- kolla_path: "/home/vagrant/kolla"
+ kolla_path: "/home/vagrant/kolla",
+ kolla_ansible_path: "/home/vagrant/kolla-ansible"
}
}
}
@@ -159,6 +167,13 @@ def configure_wifi_if_enabled(vm)
end
Vagrant.configure(2) do |config|
+
+ # check for kolla repo to be available
+ unless File.directory?(kolla_repo_path)
+ raise VagrantConfigMissing,
+ "Missing kolla repository checkout at #{kolla_repo_path}"
+ end
+
config.vm.box = get_default(:base_image)
# Next to the hostonly NAT-network there is a host-only network with all
@@ -209,8 +224,9 @@ Vagrant.configure(2) do |config|
# The operator controls the deployment
config.vm.define "operator", primary: true do |admin|
admin.vm.hostname = "operator.local"
- admin.vm.provision :shell, path: PROVISION_SCRIPT, args: "operator #{MULTINODE ? 'multinode' : 'aio'} #{get_default(:kolla_path)}"
- admin.vm.synced_folder File.join(vagrant_dir, '..', '..', '..'), get_default(:kolla_path), create:"True", type: get_default(:sync_method)
+ admin.vm.provision :shell, path: PROVISION_SCRIPT, args: "operator #{MULTINODE ? 'multinode' : 'aio'} #{get_default(:kolla_path)} #{get_default(:kolla_ansible_path)}"
+ admin.vm.synced_folder kolla_ansible_repo_path, get_default(:kolla_ansible_path), create:"True", type: get_default(:sync_method)
+ admin.vm.synced_folder kolla_repo_path, get_default(:kolla_path), create:"True", type: get_default(:sync_method)
admin.vm.synced_folder File.join(vagrant_dir, 'storage', 'operator'), "/data/host", create:"True", type: get_default(:sync_method)
admin.vm.synced_folder File.join(vagrant_dir, 'storage', 'shared'), "/data/shared", create:"True", type: get_default(:sync_method)
admin.vm.synced_folder ".", get_default(:vagrant_shared_folder), disabled: true
@@ -231,7 +247,7 @@ Vagrant.configure(2) do |config|
hostname = "#{node_type}0#{i}"
config.vm.define hostname do |node|
node.vm.hostname = "#{hostname}.local"
- node.vm.provision :shell, path: PROVISION_SCRIPT, args: "#{hostname} multinode #{get_default(:kolla_path)}"
+ node.vm.provision :shell, path: PROVISION_SCRIPT, args: "#{hostname} multinode #{get_default(:kolla_path)} #{get_default(:kolla_ansible_path)}"
node.vm.synced_folder File.join(vagrant_dir, 'storage', node_type), "/data/host", create:"True", type: get_default(:sync_method)
node.vm.synced_folder File.join(vagrant_dir, 'storage', 'shared'), "/data/shared", create:"True", type: get_default(:sync_method)
node.vm.synced_folder ".", get_default(:vagrant_shared_folder), disabled: true
diff --git a/contrib/dev/vagrant/Vagrantfile.custom.example b/contrib/dev/vagrant/Vagrantfile.custom.example
index 09af72f5b..aa4193d3f 100644
--- a/contrib/dev/vagrant/Vagrantfile.custom.example
+++ b/contrib/dev/vagrant/Vagrantfile.custom.example
@@ -28,7 +28,8 @@
# bridge_interface: "virbr0",
# vagrant_shared_folder: "/home/vagrant/sync",
# sync_method: "nfs",
-# kolla_path: "/home/vagrant/kolla"
+# kolla_path: "/home/vagrant/kolla",
+# kolla_ansible_path: "/home/vagrant/kolla-ansible"
# }
# },
# virtualbox: {
@@ -37,14 +38,16 @@
# bridge_interface: "wlp3s0b1",
# vagrant_shared_folder: "/home/vagrant/sync",
# sync_method: "virtualbox",
-# kolla_path: "/home/vagrant/kolla"
+# kolla_path: "/home/vagrant/kolla",
+# kolla_ansible_path: "/home/vagrant/kolla-ansible"
# },
# ubuntu: {
# base_image: "ubuntu/wily64",
# bridge_interface: "wlp3s0b1",
# vagrant_shared_folder: "/home/vagrant/sync",
# sync_method: "virtualbox",
-# kolla_path: "/home/vagrant/kolla"
+# kolla_path: "/home/vagrant/kolla",
+# kolla_ansible_path: "/home/vagrant/kolla-ansible"
# }
# }
# }
diff --git a/contrib/dev/vagrant/bootstrap.sh b/contrib/dev/vagrant/bootstrap.sh
index 9bc1fb627..0719e5b1a 100644
--- a/contrib/dev/vagrant/bootstrap.sh
+++ b/contrib/dev/vagrant/bootstrap.sh
@@ -9,6 +9,7 @@
VM=$1
MODE=$2
KOLLA_PATH=$3
+KOLLA_ANSIBLE_PATH=$4
export http_proxy=
export https_proxy=
@@ -168,6 +169,7 @@ function configure_operator {
pip install --upgrade "ansible>=2" python-openstackclient python-neutronclient tox
+ pip install ${KOLLA_ANSIBLE_PATH}
pip install ${KOLLA_PATH}
# Set selinux to permissive
@@ -177,8 +179,9 @@ function configure_operator {
fi
tox -c ${KOLLA_PATH}/tox.ini -e genconfig
- cp -r ${KOLLA_PATH}/etc/kolla/ /etc/kolla
- ${KOLLA_PATH}/tools/generate_passwords.py
+ cp -r ${KOLLA_ANSIBLE_PATH}/etc/kolla/ /etc/kolla
+ cp -r ${KOLLA_PATH}/etc/kolla/* /etc/kolla
+ ${KOLLA_ANSIBLE_PATH}/tools/generate_passwords.py
mkdir -p /usr/share/kolla
chown -R vagrant: /etc/kolla /usr/share/kolla