It would be nice if ansible-ssh supported ansible inventory scripts. I did the following hack in my locally installed ansible-ssh:
--- /home/olivier/bin/ansible-ssh.orig 2020-10-01 15:50:55.782872483 -0400
+++ /home/olivier/bin/ansible-ssh 2020-10-01 15:50:29.619670838 -0400
@@ -27,7 +27,7 @@
# All other arguments are ssh arguments
shift
-inventory=$(ansible-inventory --host "$host")
+inventory=$(ansible-inventory -i ansible/terraform.py --host "$host")
if [ $? -ne 0 ]; then
echo "ERROR: ansible inventory failed to gather info on $host"
exit 1
However, adding a -i flag before the hostname to pass in the ansible inventory script (in my case ansible/terraform.py) would make it more properly supported. I'm willing to submit a PR but would like to know if you are interested in such a change first.
Very nice script btw! I like it very much.
It would be nice if ansible-ssh supported ansible inventory scripts. I did the following hack in my locally installed ansible-ssh:
However, adding a
-i
flag before the hostname to pass in the ansible inventory script (in my caseansible/terraform.py
) would make it more properly supported. I'm willing to submit a PR but would like to know if you are interested in such a change first.