Skip to content

Commit

Permalink
pickup valid changes from #656
Browse files Browse the repository at this point in the history
  • Loading branch information
amitsagtani97 committed Oct 14, 2023
1 parent bcd67b1 commit 924c97d
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 12 deletions.
2 changes: 1 addition & 1 deletion ansible/inventory/offline/99-static
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
# If you install restund together with other services on the same machine
# you need to restund_allowed_private_network_cidrs to allow these services
# to communicate on the private network. E.g. If your private network is 172.16.0.1/24
# restund_allowed_private_network_cidrs = '["172.16.0.1/24"]'
# restund_allowed_private_network_cidrs = '["172.16.0.0/24"]'

# Explicitely specify the restund user id to be "root" to override the default of "997"
restund_uid = root
Expand Down
45 changes: 35 additions & 10 deletions bin/offline-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,59 @@ set -x

ls $ANSIBLE_DIR/inventory/offline

if [ -f "$ANSIBLE_DIR/inventory/offline/hosts.ini" ]
then
INVENTORY_FILE="$ANSIBLE_DIR/inventory/offline/hosts.ini"
else
if [ -f "$ANSIBLE_DIR/inventory/offline/inventory.yml" ]
then
INVENTORY_FILE="$ANSIBLE_DIR/inventory/offline/inventory.yml"
else
{
echo "no inventory file in ansible/inventory/offline/. please supply an inventory.yml or hosts.ini."
exit -1
}
fi
fi

if [ -f "$ANSIBLE_DIR/inventory/offline/hosts.ini" ] && [ -f "$ANSIBLE_DIR/inventory/offline/inventory.ymp" ]
then
{
echo "both hosts.ini and inventory.yml provided in ansible/inventory/offline! pick only one."
exit -1
}
fi

echo "using ansible inventory: $INVENTORY_FILE"

# Populate the assethost, and prepare to install images from it.
#
# Copy over binaries and debs, serves assets from the asset host, and configure
# other hosts to fetch debs from it.
#
# If this step fails partway, and you know that parts of it completed, the `--skip-tags debs,binaries,containers,containers-helm,containers-other` tags may come in handy.
ansible-playbook -i $ANSIBLE_DIR/inventory/offline $ANSIBLE_DIR/setup-offline-sources.yml
ansible-playbook -i $INVENTORY_FILE $ANSIBLE_DIR/setup-offline-sources.yml

# Run kubespray until docker is installed and runs. This allows us to preseed the docker containers that
# are part of the offline bundle
ansible-playbook -i $ANSIBLE_DIR/inventory/offline $ANSIBLE_DIR/kubernetes.yml --tags bastion,bootstrap-os,preinstall,container-engine
ansible-playbook -i $INVENTORY_FILE $ANSIBLE_DIR/kubernetes.yml --tags bastion,bootstrap-os,preinstall,container-engine

# Install docker on the restund nodes
ansible-playbook -i $ANSIBLE_DIR/inventory/offline $ANSIBLE_DIR/restund.yml --tags docker
ansible-playbook -i $INVENTORY_FILE $ANSIBLE_DIR/restund.yml --tags docker

# With ctr being installed on all nodes that need it, seed all container images:
ansible-playbook -i $ANSIBLE_DIR/inventory/offline $ANSIBLE_DIR/seed-offline-containerd.yml
ansible-playbook -i $INVENTORY_FILE $ANSIBLE_DIR/seed-offline-containerd.yml

# Install NTP
ansible-playbook -i $ANSIBLE_DIR/inventory/offline $ANSIBLE_DIR/sync_time.yml -v
ansible-playbook -i $INVENTORY_FILE $ANSIBLE_DIR/sync_time.yml -v

# Run the rest of kubespray. This should bootstrap a kubernetes cluster successfully:
ansible-playbook -i $ANSIBLE_DIR/inventory/offline $ANSIBLE_DIR/kubernetes.yml --skip-tags bootstrap-os,preinstall,container-engine
ansible-playbook -i $INVENTORY_FILE $ANSIBLE_DIR/kubernetes.yml --skip-tags bootstrap-os,preinstall,container-engine

./bin/fix_default_router.sh

# Deploy all other services which don't run in kubernetes.
ansible-playbook -i $ANSIBLE_DIR/inventory/offline $ANSIBLE_DIR/cassandra.yml
ansible-playbook -i $ANSIBLE_DIR/inventory/offline $ANSIBLE_DIR/elasticsearch.yml
ansible-playbook -i $ANSIBLE_DIR/inventory/offline $ANSIBLE_DIR/minio.yml
ansible-playbook -i $ANSIBLE_DIR/inventory/offline $ANSIBLE_DIR/restund.yml
ansible-playbook -i $INVENTORY_FILE $ANSIBLE_DIR/cassandra.yml
ansible-playbook -i $INVENTORY_FILE $ANSIBLE_DIR/elasticsearch.yml
ansible-playbook -i $INVENTORY_FILE $ANSIBLE_DIR/minio.yml
ansible-playbook -i $INVENTORY_FILE $ANSIBLE_DIR/restund.yml
2 changes: 1 addition & 1 deletion offline/docs_ubuntu_22.04.md
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ deeplink_title = "wire demo environment, example.com"
[restund:vars]
restund_uid = root
restund_allowed_private_network_cidrs='["172.16.0.1/24"]'
restund_allowed_private_network_cidrs='["172.16.0.0/24"]'
[rmq-cluster:vars]
rabbitmq_network_interface = enp1s0
Expand Down

0 comments on commit 924c97d

Please sign in to comment.