Further updates

* Add extra bootstrap flags, will need to parametrise these at some point
* ensure nodes are tagged when they are newly created
* assign the same ip suffix on the hypervisors for consistency
This commit is contained in:
Arif Ali 2021-12-20 02:37:48 +00:00
parent 3d718f3074
commit 400484e503
Signed by: arif
GPG Key ID: 369608FBA1353A70
4 changed files with 11 additions and 4 deletions

View File

@ -327,7 +327,7 @@ EOF
cat > config-"$rand_uuid".yaml <<EOF
automatically-retry-hooks: true
mongo-memory-profile: default
default-series: bionic
default-series: $juju_bootstrap_series
transmit-vendor-metrics: false
EOF
@ -354,7 +354,10 @@ fi
echo "Details for cloud.......: $cloud_name..."
juju clouds --local --format json | jq --arg cloud "$cloud_name" '.[$cloud]'
juju bootstrap "$cloud_name" --debug --config=config-"$rand_uuid".yaml --constraints "tags=juju"
juju bootstrap "$cloud_name" --debug --config=config-"$rand_uuid".yaml \
--model-default image-metadata-url=http://192.168.1.12/lxd/ \
--model-default agent-metadata-url=http://192.168.1.12/juju/tools/ \
--constraints "tags=juju"
# Since we created ephemeral files, let's wipe them out. Comment if you want to keep them around
if [[ $? = 0 ]]; then

View File

@ -1,5 +1,6 @@
juju_version="2.8/stable"
juju_ha="true"
juju_bootstrap_series="focal"
launchpad_user="arif-ali"
package_repository="http://192.168.1.12/archive.ubuntu.com/ubuntu/"
maas_bridge_ip="10.0.1.253"

View File

@ -20,9 +20,10 @@ maas_assign_networks()
i=0
for vlan in ${vlans[*]}
do
subnet_line=$(maas admin subnets read | jq -rc --arg vlan "$vlan" ".[] | select(.vlan.vid == $vlan) | select(.name | contains(\"/24\"))| {subnet_id:.id, vlan_id:.vlan.id}")
subnet_line=$(maas admin subnets read | jq -rc --arg vlan "$vlan" ".[] | select(.vlan.vid == $vlan) | select(.name | contains(\"/24\"))| {subnet_id:.id, vlan_id:.vlan.id, cidr: .cidr}")
maas_vlan_id=$(echo $subnet_line | jq .vlan_id | sed s/\"//g)
maas_subnet_id=$(echo $subnet_line | jq .subnet_id | sed s/\"//g)
sub_prefix=$(echo $subnet_line | jq .cidr | sed s/\"//g | sed 's/0\/24//g' )
ip_addr=""
if [[ $i -eq 0 ]] ; then
# Set the first interface to be static as per the configuration so that it
@ -43,7 +44,8 @@ maas_assign_networks()
ip_addr="ip_address=$external_ip"
else
# Set everything else to be auto assigned
mode="AUTO"
mode="STATIC"
ip_addr="ip_address=${sub_prefix}${ip_suffix}"
fi
fi
# Check to see if the bridge interface already exists, otherwise create it

View File

@ -515,6 +515,7 @@ while getopts ":cdjnprtwz" opt; do
case $opt in
c)
create_vms
do_nodes tag
;;
d)
install_deps