3 ms·
I did something Similar, but fully based in shell scripts with no dependencies -> https://gist.github.com/mariocesar/8e674ec40dad6b94114d2a44d9151e23 https://g
by mariocesar 9y ago
I did something Similar, but fully based in shell scripts with no dependencies -> https://gist.github.com/mariocesar/8e674ec40dad6b94114d2a44d9151e23 https://gist.github.com/mariocesar/8e674ec40dad6b94114d2a44d...
I completely agree with OP when Ansible is overkill for must cases, and even slower than a plain smart shell script.
For my solution, simple create a bash function:
function play ()
local remote=${2}
local script=${1}
local directory=$(dirname ${script})
tar cpf - ${directory}/ | ssh -t ${remote} "
tar xpf - -C /tmp &&
cd /tmp/${dirname} &&
bash /tmp/${script} &&
rm -rf /tmp/${dirname} "
}
and later just call it like.
play provision/bootstrap.sh ubuntu@10.0.0.1
Where provision is a directory, and bootstrap.sh is the main shell script.