You can define the distribution on a remote host and deploy accordingly. in deploy.sh:
DISTRO=`ssh -o 'StrictHostKeyChecking no' ${host} 'bash -s' < bootstrap.sh`
The DISTRO variable is populated with what is encountered using the bootstrap.sh script that runs on the host machine. So, now we can use bootstrap.sh to determine the distribution parameters or other server parameters that we need and the echo that will be marked in the local script, and you can respond accordingly.
example deploy.sh:
#!/bin/bash
example bootstrap.sh:
#!/bin/bash # Fedora/RHEL/CentOS distro if [ -f /etc/redhat-release ]; then echo "FED" # Debian/Ubuntu elif [ -r /lib/lsb/init-functions ]; then echo "DEB" fi
This will allow you to discover the platform very early in the deployment process.
offwhite
source share