From ebe71df17532c3f2645a0cfdb1067b2d0002ac15 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sun, 14 Jul 2019 06:09:45 +0300 Subject: [PATCH] Feat: Add `ansible-ssh` A script to create SSH connection sharing control path (alsmost) the same way ansible does it. Requires [ssh_connection] ssh_args = -C -o ControlMaster=auto -o ControlPath="~/.ssh/controls/%r@%h:%p" -o ControlPersist=600 in `~/.ansible.cfg`. --- ansible-ssh | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 ansible-ssh diff --git a/ansible-ssh b/ansible-ssh new file mode 100755 index 0000000..9ccda46 --- /dev/null +++ b/ansible-ssh @@ -0,0 +1,8 @@ +#! /bin/sh + +if [ -z "$1" ]; then + echo "Usage: $0 host [port]" >&2 + exit 1 +fi + +exec ssh -C -o ControlMaster=auto -o ControlPath="$HOME/.ansible/cp/ansible-ssh-%h-%p-%r" -o ControlPersist=600 "$1" -p "${2:-22}" -- 2.39.5