Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I did something Similar, but fully based in shell scripts with no dependencies -> 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 [email protected]
Where provision is a directory, and bootstrap.sh is the main shell script.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: