Skip to content

Instantly share code, notes, and snippets.

@JohnPreston
Created April 25, 2016 14:53
Show Gist options
  • Save JohnPreston/f027bb2ed193f4a6c975bb90c7d8cefa to your computer and use it in GitHub Desktop.
Save JohnPreston/f027bb2ed193f4a6c975bb90c7d8cefa to your computer and use it in GitHub Desktop.
Duplicate host_vars from an original file.
#!/usr/bin/env bash
# Duplicate a valida source file and changes the IP address following the IP pattern
for server in {56..86}; do
IP=`echo $server + 30 | bc`
echo "server $server will have IP $IP"
rm -rfv ustlsaime0$server
cp ustlsaime055 ustlsaime0$server
sed -i "s/85/$IP/g" ustlsaime0$server
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment