Skip to content

Instantly share code, notes, and snippets.

@suresh-mahawar
suresh-mahawar / deployment-startup.sh
Created November 4, 2025 08:16
deployment-startup.sh
#!/bin/bash
set -e
if ! command -v git &> /dev/null; then
echo "Error: Git command not found. Please install Git and configure GitHub authentication."
exit 1
fi
if ! command -v find &> /dev/null; then
echo "Error: Find command not found. Please install Find."
@suresh-mahawar
suresh-mahawar / .ansible.cfg
Created November 19, 2024 07:28 — forked from wbcurry/.ansible.cfg
Ansible: .ansible.cfg
# config file for ansible -- http://ansible.com/
# ==============================================
# nearly all parameters can be overridden in ansible-playbook
# or with command line flags. ansible will read ANSIBLE_CONFIG,
# ansible.cfg in the current working directory, .ansible.cfg in
# the home directory or /etc/ansible/ansible.cfg, whichever it
# finds first
[defaults]
Host *
ForwardAgent yes
ControlMaster auto
ControlPath /tmp/%r@%h:%p
ServerAliveInterval 30
ServerAliveCountMax 10
AddKeysToAgent yes
StrictHostKeyChecking no
PubkeyAcceptedKeyTypes=+ssh-rsa
HostKeyAlgorithms=+ssh-rsa
#!/bin/bash
gcloud compute instances list --filter=gke-cluster --format="json" | jq '.[] | {name, external_ip: .networkInterfaces[0]["accessConfigs"][0].natIP}'
{
# filter not empty, not null based on field in array
curl -s --location --request GET -H "Authorization: Bearer $token" -H "CF-Access-Client-Id: $CF_Access_Id" -H "CF-Access-Client-Secret: $CF_Access_Secret" https://$ARGOCD_DOMAIN/api/v1/clusters| jq '.items|=sort_by(.name) | .items[] | {name,server,serverVersion} | select( .serverVersion != null ) | join("=")' --raw-output
# set default value in field of array
curl -s --location --request GET -H "Authorization: Bearer $token" -H "CF-Access-Client-Id: $CF_Access_Id" -H "CF-Access-Client-Secret: $CF_Access_Secret" https://$ARGOCD_DOMAIN/api/v1/clusters| jq '.items|=sort_by(.name) | .items[] | {name,server,serverVersion} | [.[] | . // "unknown"] | join("=")' --raw-output
#!/bin/bash
clusterList=$(kubectl config get-contexts --output=name)
while read line; do
contexts[${#contexts[@]}]="$line";
done <<< "$clusterList";
select context in "${contexts[@]}"
do
echo "Selected => $context";
#!/bin/bash
echo "Installed ansible versions";
for i in $(ls $HOME/avm_dir/versions);
do
echo $i;
done
echo Choose ansible version:
read line < /dev/tty
ANSIBLE_VERSION=$line;
#!/bin/bash
PYTHON_BIN=$1
ANSIBLE_CORE_VERSION=$2
ANSIBLE_PACKAGE_VERSION=$3
PYTHON_BIN="${PYTHON_BIN:-python3.11}"
ANSIBLE_CORE_VERSION="${ANSIBLE_CORE_VERSION:-2.14}"
ANSIBLE_PACKAGE_VERSION="${ANSIBLE_PACKAGE_VERSION:-7.2.0}"
#!/bin/bash
echo "Installed ansible versions";
for i in $(ls $HOME/avm_dir/versions);
do
echo $i;
done
echo Choose ansible version:
read line < /dev/tty
ANSIBLE_VERSION=$line;
@suresh-mahawar
suresh-mahawar / argocd-create-deployment-manifests.sh
Last active July 10, 2023 12:38
argocd-create-deployment-manifests.sh
#!/bin/bash
clear
getAppName() {
echo -e "\n*** Please enter your application name: ***"
read APP_NAME
}
getBranchStrategy() {
echo -e "\n*** Please select GitHub repository branch name if your app follows a single branch workflow strategy? ***"