added support for install from git repository. please modify 23/34023/15
authorNarinder Gupta <narinder.gupta@canonical.com>
Mon, 1 May 2017 19:32:51 +0000 (14:32 -0500)
committerNarinder Gupta <narinder.gupta@canonical.com>
Tue, 2 May 2017 20:31:47 +0000 (15:31 -0500)
default_deployment_config.yaml to install from release repo
for ocata,master etc. Also user can define their own URL and
more information can be obtained at jujucharms.com

Change-Id: I4943dbf68c6d980b2a2da65417b16631df768b48
Signed-off-by: Narinder Gupta <narinder.gupta@canonical.com>
15 files changed:
ci/03-maasdeploy.sh
ci/config_tpl/juju2/bundle_tpl/cinder.yaml
ci/config_tpl/juju2/bundle_tpl/glance.yaml
ci/config_tpl/juju2/bundle_tpl/keystone.yaml
ci/config_tpl/juju2/bundle_tpl/neutron-api.yaml
ci/config_tpl/juju2/bundle_tpl/neutron-gateway.yaml
ci/config_tpl/juju2/bundle_tpl/neutron-ovs.yaml
ci/config_tpl/juju2/bundle_tpl/nova-cloud-controller.yaml
ci/config_tpl/juju2/bundle_tpl/nova-compute.yaml
ci/config_tpl/juju2/bundle_tpl/openstack-dashboard.yaml
ci/default_deployment_config.yaml
ci/deploy.sh
ci/k8.sh
ci/openstack.sh
juju/joid-configure-openstack

index 43e9585..f66d0cb 100755 (executable)
@@ -12,7 +12,7 @@ fi
 #install the packages needed
 sudo apt-add-repository ppa:juju/stable -y
 sudo apt-add-repository ppa:maas/stable -y
-sudo apt-add-repository cloud-archive:newton -y
+sudo apt-add-repository cloud-archive:ocata -y
 sudo apt-get update -y
 #sudo apt-get dist-upgrade -y
 sudo apt-get install bridge-utils openssh-server bzr git virtinst qemu-kvm libvirt-bin juju \
@@ -404,7 +404,7 @@ addnodes(){
     fi
 
     sudo virt-install --connect qemu:///system --name bootstrap --ram 4098 --cpu host --vcpus 2 --video \
-                 cirrus --arch x86_64 --disk size=20,format=qcow2,bus=virtio,io=native,pool=default \
+                 cirrus --arch x86_64 --disk size=20,format=qcow2,bus=virtio,cache=directsync,io=native,pool=default \
                  $netw --boot network,hd,menu=off --noautoconsole \
                  --vnc --print-xml | tee bootstrap
 
@@ -437,7 +437,7 @@ addnodes(){
            NODE_NAME=`cat labconfig.json | jq ".lab.racks[].nodes[$units].name" | cut -d \" -f 2 `
 
             sudo virt-install --connect qemu:///system --name $NODE_NAME --ram 8192 --cpu host --vcpus 4 \
-                     --disk size=120,format=qcow2,bus=virtio,io=native,pool=default \
+                     --disk size=120,format=qcow2,bus=virtio,cache=directsync,io=native,pool=default \
                      $netw $netw --boot network,hd,menu=off --noautoconsole --vnc --print-xml | tee $NODE_NAME
 
             nodemac=`grep  "mac address" $NODE_NAME | head -1 | cut -d '"' -f 2`
index 8b26e25..cce12e0 100644 (file)
@@ -18,6 +18,9 @@
 {% endif %}
       options:
         openstack-origin: "cloud:{{ ubuntu.release }}-{{ os.release }}"
+{% if os.git_repo.origin_git %}
+        openstack-origin-git: "{{ os.git_repo.branch }}"
+{% endif %}
         region: {{ os.region }}
         block-device: None
         glance-api-version: 2
index 3329ea4..be80bb3 100644 (file)
@@ -14,6 +14,9 @@
 {% endif %}
       options:
         openstack-origin: "cloud:{{ ubuntu.release }}-{{ os.release }}"
+{% if os.git_repo.origin_git %}
+        openstack-origin-git: "{{ os.git_repo.branch }}"
+{% endif %}
         region: {{ os.region }}
 {% if os.beta.public_api %}
         use-internal-endpoints: true
index 4f81dc5..0d21f64 100644 (file)
 {% endif %}
       options:
         openstack-origin: "cloud:{{ ubuntu.release }}-{{ os.release }}"
+{% if os.git_repo.origin_git %}
+        openstack-origin-git: "{{ os.git_repo.branch }}"
+{% endif %}
         region: {{ os.region }}
         admin-role: {{ os.admin.role }}
         keystone-admin-role: {{ os.admin.role }}
-        preferred-api-version: 2
+        preferred-api-version: 3
 {% if os.network.ipv6 %}
         prefer-ipv6: {{ os.network.ipv6 }}
 {% endif %}
index 0febddd..620cc02 100644 (file)
@@ -14,6 +14,9 @@
 {% endif %}
       options:
         openstack-origin: "cloud:{{ ubuntu.release }}-{{ os.release }}"
+{% if os.git_repo.origin_git %}
+        openstack-origin-git: "{{ os.git_repo.branch }}"
+{% endif %}
         region: {{ os.region }}
         neutron-security-groups: true
 {% if os.beta.public_api %}
index f0416a7..d1159bb 100644 (file)
@@ -12,6 +12,9 @@
 {% endif %}
       options:
         openstack-origin: "cloud:{{ ubuntu.release }}-{{ os.release }}"
+{% if os.git_repo.origin_git %}
+        openstack-origin-git: "{{ os.git_repo.branch }}"
+{% endif %}
 {% if os.api.worker_multiplier %}
         worker-multiplier: {{ os.api.worker_multiplier }}
 {% endif %}
index 1dd2210..65ecdd7 100644 (file)
@@ -12,6 +12,9 @@
 {% endif %}
 {% else %}
       options:
+{% if os.git_repo.origin_git %}
+        openstack-origin-git: "{{ os.git_repo.branch }}"
+{% endif %}
 {% if opnfv.spaces_dict.data is defined %}
         os-data-network: {{ opnfv.spaces_dict.data.cidr }}
 {% endif %}
index b5fdb10..8373b2b 100644 (file)
@@ -14,6 +14,9 @@
 {% endif %}
       options:
         openstack-origin: "cloud:{{ ubuntu.release }}-{{ os.release }}"
+{% if os.git_repo.origin_git %}
+        openstack-origin-git: "{{ os.git_repo.branch }}"
+{% endif %}
         region: {{ os.region }}
         console-access-protocol: novnc
         neutron-external-network: ext-net
index 29a5f40..66d5385 100644 (file)
@@ -11,6 +11,9 @@
 {% endif %}
       options:
         openstack-origin: "cloud:{{ ubuntu.release }}-{{ os.release }}"
+{% if os.git_repo.origin_git %}
+        openstack-origin-git: "{{ os.git_repo.branch }}"
+{% endif %}
         enable-live-migration: true
         enable-resize: true
         migration-auth-type: ssh
index bf0ac99..cba9b79 100644 (file)
@@ -15,6 +15,9 @@
 {% endif %}
       options:
         openstack-origin: "cloud:{{ ubuntu.release }}-{{ os.release }}"
+{% if os.git_repo.origin_git %}
+        openstack-origin-git: "{{ os.git_repo.branch }}"
+{% endif %}
         secret: admin
         webroot: /
 {% if os.network.ipv6 %}
index 2e97b86..0285ebc 100644 (file)
@@ -1,7 +1,10 @@
 ubuntu:
     release: xenial
 os:
-    release: newton
+    release: ocata
+    git_repo:
+        origin_git: False
+        branch: ocata
     hyperconverged: True
     ha:
         mode: ha
@@ -30,7 +33,7 @@ os:
         cpu_pin: False
         cpu_pin_set: all
     service:
-        congress: True
+        congress: False
         promise: True
         bindings: True
         openbaton: False
index e1ec7a6..b0df68b 100755 (executable)
@@ -7,9 +7,9 @@ set -ex
 
 opnfvsdn=nosdn
 opnfvtype=nonha
-openstack=newton
+openstack=ocata
 opnfvlab=default
-opnfvrel=d
+opnfvrel=e
 opnfvfeature=none
 opnfvdistro=xenial
 opnfvarch=amd64
@@ -88,7 +88,7 @@ createresource() {
         if [[ -z "$node_id" ]]; then
             sudo virt-install --connect qemu:///system --name $node \
                 --ram 8192 --cpu host --vcpus 4 \
-                --disk size=120,format=qcow2,bus=virtio,io=native,pool=default \
+                --disk size=120,format=qcow2,bus=virtio,cache=directsync,io=native,pool=default \
                 --network bridge=virbr0,model=virtio \
                 --network bridge=virbr0,model=virtio \
                 --boot network,hd,menu=off \
@@ -136,6 +136,11 @@ deploy() {
                 echo " MAAS not deployed please deploy MAAS first."
             fi
         fi
+#create json file which is missing in case of new deployment after maas and git tree cloned freshly.
+
+        python -c 'import sys, yaml, json; json.dump(yaml.load(sys.stdin), sys.stdout, indent=4)' < labconfig.yaml > labconfig.json
+        python -c 'import sys, yaml, json; json.dump(yaml.load(sys.stdin), sys.stdout, indent=4)' < deployconfig.yaml > deployconfig.json
+
     else
         if [ ! -f ./environments.yaml ] && [ -e ~/.juju/environments.yaml ]; then
             cp ~/.juju/environments.yaml ./environments.yaml
index cb7dd49..5e0f4a4 100755 (executable)
--- a/ci/k8.sh
+++ b/ci/k8.sh
@@ -6,7 +6,7 @@ mkdir -p ~/.kube || true
 juju scp kubernetes-master/0:config ~/.kube/config || true
 
 if [ ! -f /snap/kubectl/current/kubectl ]; then
-  sudo apt-get install snapd
+  sudo apt-get install snapd -y
   sudo snap install kubectl --classic
 fi
 
index 80355df..24d068f 100755 (executable)
@@ -92,41 +92,25 @@ create_openrc() {
         adminPasswd=$(juju config keystone | grep admin-password -A 5 | grep value | awk '{print $2}' 2> /dev/null)
     fi
 
-    configOpenrc admin $adminPasswd admin http://$keystoneIp:5000/v2.0 RegionOne > ~/joid_config/admin-openrc
+    configOpenrc admin $adminPasswd admin http://$keystoneIp:5000/v3 RegionOne > ~/joid_config/admin-openrc
+
     chmod 0600 ~/joid_config/admin-openrc
 }
 
 configOpenrc() {
-if [ "$API_FQDN" != "None" ]; then
-    cat <<-EOF
-        export SERVICE_ENDPOINT=$4
-        unset SERVICE_TOKEN
-        unset SERVICE_ENDPOINT
-        export OS_USERNAME=$1
-        export OS_PASSWORD=$2
-        export OS_TENANT_NAME=$3
-        export OS_AUTH_URL=$4
-        export OS_REGION_NAME=$5
-        export OS_ENDPOINT_TYPE='internalURL'
-        export CINDER_ENDPOINT_TYPE='internalURL'
-        export GLANCE_ENDPOINT_TYPE='internalURL'
-        export KEYSTONE_ENDPOINT_TYPE='internalURL'
-        export NEUTRON_ENDPOINT_TYPE='internalURL'
-        export NOVA_ENDPOINT_TYPE='internalURL'
-EOF
-else
-    cat <<-EOF
-        export SERVICE_ENDPOINT=$4
-        unset SERVICE_TOKEN
-        unset SERVICE_ENDPOINT
-        export OS_USERNAME=$1
-        export OS_PASSWORD=$2
-        export OS_TENANT_NAME=$3
-        export OS_AUTH_URL=$4
-        export OS_REGION_NAME=$5
+cat <<-EOF
+export OS_AUTH_URL=$4
+export OS_USERNAME=$1
+export OS_PASSWORD=$2
+export OS_USER_DOMAIN_NAME=admin_domain
+export OS_PROJECT_DOMAIN_NAME=admin_domain
+export OS_PROJECT_NAME=$3
+export OS_TENANT_NAME=$3
+export OS_REGION_NAME=$5
+export OS_IDENTITY_API_VERSION=3
+# Swift needs this:
+export OS_AUTH_VERSION=3
 EOF
-
-fi
 }
 
 if [ "$API_FQDN" != "None" ]; then
@@ -232,36 +216,38 @@ neutron subnet-show ext-subnet > /dev/null 2>&1 || neutron subnet-create ext-net
    --name ext-subnet --allocation-pool start=$EXTNET_FIP,end=$EXTNET_LIP \
    --disable-dhcp --gateway $EXTNET_GW $EXTNET_NET
 
+#congress team is not updating and supporting charm anymore so defer it.
+
 # Create Congress datasources
-sudo apt-get install -y python-congressclient
-
-openstack congress datasource create nova "nova" \
-  --config username=$OS_USERNAME \
-  --config tenant_name=$OS_TENANT_NAME \
-  --config password=$OS_PASSWORD \
-  --config auth_url=http://$keystoneIp:5000/v2.0
-openstack congress datasource create neutronv2 "neutronv2" \
-  --config username=$OS_USERNAME \
-  --config tenant_name=$OS_TENANT_NAME \
-  --config password=$OS_PASSWORD \
-  --config auth_url=http://$keystoneIp:5000/v2.0
-openstack congress datasource create ceilometer "ceilometer" \
-  --config username=$OS_USERNAME \
-  --config tenant_name=$OS_TENANT_NAME \
-  --config password=$OS_PASSWORD \
-  --config auth_url=http://$keystoneIp:5000/v2.0
-openstack congress datasource create cinder "cinder" \
-  --config username=$OS_USERNAME \
-  --config tenant_name=$OS_TENANT_NAME \
-  --config password=$OS_PASSWORD \
-  --config auth_url=http://$keystoneIp:5000/v2.0
-openstack congress datasource create glancev2 "glancev2" \
-  --config username=$OS_USERNAME \
-  --config tenant_name=$OS_TENANT_NAME \
-  --config password=$OS_PASSWORD \
-  --config auth_url=http://$keystoneIp:5000/v2.0
-openstack congress datasource create keystone "keystone" \
-  --config username=$OS_USERNAME \
-  --config tenant_name=$OS_TENANT_NAME \
-  --config password=$OS_PASSWORD \
-  --config auth_url=http://$keystoneIp:5000/v2.0
+#sudo apt-get install -y python-congressclient
+
+#openstack congress datasource create nova "nova" \
+#  --config username=$OS_USERNAME \
+#  --config tenant_name=$OS_TENANT_NAME \
+#  --config password=$OS_PASSWORD \
+#  --config auth_url=http://$keystoneIp:5000/v2.0
+#openstack congress datasource create neutronv2 "neutronv2" \
+#  --config username=$OS_USERNAME \
+#  --config tenant_name=$OS_TENANT_NAME \
+#  --config password=$OS_PASSWORD \
+#  --config auth_url=http://$keystoneIp:5000/v2.0
+#openstack congress datasource create ceilometer "ceilometer" \
+#  --config username=$OS_USERNAME \
+#  --config tenant_name=$OS_TENANT_NAME \
+#  --config password=$OS_PASSWORD \
+#  --config auth_url=http://$keystoneIp:5000/v2.0
+#openstack congress datasource create cinder "cinder" \
+#  --config username=$OS_USERNAME \
+#  --config tenant_name=$OS_TENANT_NAME \
+#  --config password=$OS_PASSWORD \
+#  --config auth_url=http://$keystoneIp:5000/v2.0
+#openstack congress datasource create glancev2 "glancev2" \
+#  --config username=$OS_USERNAME \
+#  --config tenant_name=$OS_TENANT_NAME \
+#  --config password=$OS_PASSWORD \
+#  --config auth_url=http://$keystoneIp:5000/v2.0
+#openstack congress datasource create keystone "keystone" \
+#  --config username=$OS_USERNAME \
+#  --config tenant_name=$OS_TENANT_NAME \
+#  --config password=$OS_PASSWORD \
+#  --config auth_url=http://$keystoneIp:5000/v2.0
index 3466128..71e4f71 100755 (executable)
@@ -43,7 +43,7 @@ neutron subnet-show private_subnet > /dev/null 2>&1 || neutron subnet-create pri
 SUBNET_ID=$(neutron subnet-show private_subnet | grep " id" | awk '{print $4}')
 
 #Create router for external network and private network
-neutron router-show provider-router > /dev/null 2>&1 || neutron router-create --tenant-id $TENANT_ID provider-router
+openstack router list provider-router > /dev/null 2>&1 || openstack router create --project-domain=$OS_PROJECT_DOMAIN_NAME --project $OS_PROJECT_NAME provider-router
 ROUTER_ID=$(neutron router-show provider-router | grep " id" | awk '{print $4}')
 
 neutron router-gateway-clear provider-router || true