Commit 48935857 authored by Ubuntu's avatar Ubuntu
Browse files

correcting scripts

parent 49d71a9c
Pipeline #7596 failed with stage
in 1 minute and 28 seconds
File mode changed from 100644 to 100755
#!/bin/bash
export PDNS_NS_NAME=powerdns_ns
export VNF_NAME=powerdns
export KDU_NAME=powerdns
read -p "Enter ZONE:" ZONE
if [[ -z "$ZONE" ]]; then
......@@ -7,7 +11,6 @@ if [[ -z "$ZONE" ]]; then
exit 1
else
printf "You entered ZONE %s " "$ZONE"
ls -l
fi
echo "========================================================================"
echo "Deleting Zone"
......@@ -23,4 +26,4 @@ osm ns-op-show $DEL_ZONE_OP_ID
echo "========================================================================"
echo "Check the action status using osm ns-op-show $DEL_ZONE_OP_ID"
echo "========================================================================"
\ No newline at end of file
echo "========================================================================"
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
#!/bin/bash
sudo snap install yq
echo "========================================================================"
echo "Adding Helm Repository"
echo "========================================================================"
......@@ -7,4 +8,4 @@ osm repo-add --type helm-chart --description "Repository for Powerdns helm Chart
echo "========================================================================"
echo "Listing Helm Repository"
echo "========================================================================"
osm helm-repo list
\ No newline at end of file
osm repo-list
......@@ -4,7 +4,7 @@ echo "========================================================================"
echo "Install charmcraft"
echo "========================================================================"
sudo snap install charmcraft --classic
pushd osm-packages/Hackfest_Demos/OSM-MR13/powerdns/powerdns_knf/charms/ops/
cd ../../powerdns/powerdns_knf/charms/ops/
if [ ! -d powerdns-operator ] ; then
echo "It does not look like we are in osm-packages, exiting"
......@@ -13,10 +13,10 @@ fi
echo "========================================================================"
echo "Packing charm"
echo "========================================================================"
push powerdns-operator
pushd powerdns-operator
charmcraft pack
echo "========================================================================"
echo "Copying charm under VNFD/charms folder"
echo "========================================================================"
cp powerdns-operator_ubuntu-20.04-amd64.charm osm-packages/Hackfest_Demos/OSM-MR13/powerdns/powerdns_knf/charms/
popd; popd
cp powerdns-operator_ubuntu-20.04-amd64.charm ../../charms
popd
......@@ -3,7 +3,7 @@
echo "========================================================================"
echo "Upload VNFD"
echo "========================================================================"
pushd osm-packages/Hackfest_Demos/OSM-MR13/powerdns/
pushd ../../powerdns/
osm nfpkg-create powerdns_knf
echo "========================================================================"
......
......@@ -2,22 +2,22 @@
echo "========================================================================"
echo "Setting env variables"
echo "========================================================================"
export VNF_NAME=powerdns
export KDU_NAME=powerdns
export K8S_NET=osm-ext
export PDNS_NS_NAME=powerdns_ns
echo "========================================================================"
echo "Deploying NS"
echo "========================================================================"
export PDNS_NS_ID=`osm ns-create --ns_name $PDNS_NS_NAME --nsd_name powerdns_ns --vim_account openstack --config "{vld: [ {name: mgmtnet, vim-network-name: $K8S_NET}]}"`
osm ns-create --ns_name $PDNS_NS_NAME --nsd_name powerdns_ns --vim_account openstack --config "{vld: [ {name: mgmtnet, vim-network-name: $K8S_NET}]}"
osm ns-list
echo "========================================================================"
echo "NS_NAME: $PDNS_NS_NAME"
echo "NS_ID: $PDNS_NS_NAME deployed"
echo "========================================================================"
echo "========================================================================"
echo "Check NS status using osm ns-list, osm ns-show $PDNS_NS_ID"
echo "========================================================================"
\ No newline at end of file
echo "Check NS status using osm ns-list, osm ns-show $PDNS_NS_NAME"
echo "========================================================================"
#!/bin/bash
export PDNS_NS_NAME=powerdns_ns
VNF_ID=`osm vnf-list --ns $PDNS_NS_NAME | grep powerdns | awk '{print $2}'`
echo "========================================================================"
......@@ -15,4 +16,4 @@ echo "========================================================================"
echo "========================================================================"
echo "Setting DNS Server in your machine"
echo "========================================================================"
echo "nameserver ${DNS_IP}" | tee -a /etc/resolv.conf
\ No newline at end of file
sudo sed -i "1s/^/nameserver $DNS_IP\n/" /etc/resolv.conf
#!/bin/bash
export PDNS_NS_NAME=powerdns_ns
export VNF_NAME=powerdns
export KDU_NAME=powerdns
read -p "Enter ZONE:" ZONE
# Check if string is empty using -z. For more 'help test'
......@@ -8,7 +12,6 @@ if [[ -z "$ZONE" ]]; then
exit 1
else
printf "You entered ZONE %s " "$ZONE"
ls -l
fi
echo "========================================================================"
......@@ -25,5 +28,5 @@ echo "========================================================================"
osm ns-op-show $ADD_ZONE_OP_ID
echo "========================================================================"
echo "Check action status using osm ns-show $ADD_ZONE_OP_ID"
echo "Check action status using osm ns-op-show $ADD_ZONE_OP_ID"
echo "========================================================================"
#!/bin/bash
export PDNS_NS_NAME=powerdns_ns
export VNF_NAME=powerdns
export KDU_NAME=powerdns
read -p "Enter ZONE:" ZONE
if [[ -z "$ZONE" ]]; then
......@@ -7,7 +11,6 @@ if [[ -z "$ZONE" ]]; then
exit 1
else
printf "You entered ZONE %s " "$ZONE"
ls -l
fi
......@@ -18,7 +21,6 @@ if [[ -z "$DOMAIN" ]]; then
exit 1
else
printf "You entered DOMAIN %s " "$DOMAIN"
ls -l
fi
......@@ -28,7 +30,6 @@ if [[ -z "$IP" ]]; then
exit 1
else
printf "You entered IP %s " "$IP"
ls -l
fi
echo "========================================================================"
......@@ -43,9 +44,9 @@ echo "========================================================================"
osm ns-op-show $ADD_DOMAIN_OP_ID
echo "========================================================================"
echo "Check action status using osm ns-show $ADD_DOMAIN_OP_ID"
echo "Check action status using osm ns-op-show $ADD_DOMAIN_OP_ID"
echo "========================================================================"
echo "========================================================================"
echo "Get the list of all operations using osm ns-op-list $PDNS_NS_ID"
echo "========================================================================"
\ No newline at end of file
echo "========================================================================"
#!/bin/bash
VNF_ID=`osm vnf-list --ns $PDNS_NS_NAME | grep powerdns | awk '{print $2}'`
export PDNS_NS_NAME=powerdns_ns
export VNF_NAME=powerdns
export KDU_NAME=powerdns
echo "========================================================================"
echo "VNF ID $VNF_ID"
echo "========================================================================"
export DNS_IP=`osm vnf-show $VNF_ID --literal | yq -e '.kdur[0].services[] | select(.name | contains("udp")) | .external_ip' | tr -d ' '-`
echo "========================================================================"
echo "DNS IP $DNS_IP"
echo "========================================================================"
echo "========================================================================"
echo "Setting DNS Server in your machine"
echo "========================================================================"
echo "nameserver ${DNS_IP}" | tee -a /etc/resolv.conf
read -p "Enter DNS RECORD:" RECORD
if [[ -z "$RECORD" ]]; then
......@@ -23,7 +11,6 @@ if [[ -z "$RECORD" ]]; then
exit 1
else
printf "You entered RECORD %s " "$RECORD"
ls -l
fi
......@@ -32,9 +19,9 @@ echo "Testing record"
echo "========================================================================"
# Sample record: "test.example.org"
dig @${DNS_IP} $RECORD
dig $RECORD
echo "========================================================================"
echo "Testing the record using dig @${DNS_IP} $RECORD"
echo "========================================================================"
\ No newline at end of file
echo "========================================================================"
#!/bin/bash
export PDNS_NS_NAME=powerdns_ns
export VNF_NAME=powerdns
export KDU_NAME=powerdns
read -p "Enter ZONE:" ZONE
if [[ -z "$ZONE" ]]; then
......@@ -7,7 +11,6 @@ if [[ -z "$ZONE" ]]; then
exit 1
else
printf "You entered ZONE %s " "$ZONE"
ls -l
fi
......@@ -17,7 +20,6 @@ if [[ -z "$DOMAIN" ]]; then
exit 1
else
printf "You entered DOMAIN %s " "$DOMAIN"
ls -l
fi
......@@ -36,4 +38,4 @@ osm ns-op-show $DEL_DOM_OP_ID
echo "========================================================================"
echo "Check the action status using osm ns-op-show $DEL_DOM_OP_ID"
echo "========================================================================"
\ No newline at end of file
echo "========================================================================"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment