how to execute playbook task on Host-B directly from control machine

44 views
Skip to first unread message

Dip Giri

unread,
Mar 12, 2022, 1:17:59 PM3/12/22
to Ansible Project
First i have to connect Host-A then i can connect Host-B. i can’t connect Host-B directly. So in this case how to execute playbook task on Host-B from Control Machine. Because my control machine is centralised where have running Ansible AWX. and i can't install ansible on Host-A because there have restriction they wouldn't allow it.

So my question is how to execute playbook task on Host-B directly from control machine


Screenshot from 2022-03-12 23-46-07.png

Stefan Hornburg (Racke)

unread,
Mar 13, 2022, 8:02:11 AM3/13/22
to ansible...@googlegroups.com
On 12/03/2022 19:17, Dip Giri wrote:
> First i have to connect *Host-A*then i can connect *Host-B*. i can’t connect Host-B directly. So in this case how to execute playbook task on *Host-B *from *Control Machine. *Because my control machine is centralised where have running *Ansible AWX. * and i can't install ansible on Host-A because there have restriction they wouldn't allow it.
>
> So my question is how to execute playbooktask on *Host-B *directly from control machine
>
>
> Screenshot from 2022-03-12 23-46-07.png

Use Host-A as a jump host, e.g. https://www.jeffgeerling.com/blog/2022/using-ansible-playbook-ssh-bastion-jump-host

Regards
Racke

>
> --
> You received this message because you are subscribed to the Google Groups "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com <mailto:ansible-proje...@googlegroups.com>.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/e50b7e7c-ecf3-49b8-8375-a3b895892e1bn%40googlegroups.com <https://groups.google.com/d/msgid/ansible-project/e50b7e7c-ecf3-49b8-8375-a3b895892e1bn%40googlegroups.com?utm_medium=email&utm_source=footer>.


--
Automation expert - Ansible and friends
Linux administrator & Debian maintainer
Perl Dancer & conference hopper

OpenPGP_signature

Dip Giri

unread,
Mar 13, 2022, 11:12:04 PM3/13/22
to ansible...@googlegroups.com
Thank you sir, 

But i have another question  - 
How to give private key and there passphrase in this case 
ansible_ssh_common_args='-o ProxyCommand="ssh -p 2222 -W %h:%p -q user...@bastion.example.com"'

To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/c6edac69-16f0-85cb-6c97-1c4b1657508a%40linuxia.de.

Monica

unread,
Apr 2, 2023, 11:41:42 AM4/2/23
to Ansible Project
Hi Dip Giri,

Did you get the answer of above query I am also facing the same issue.

Reply all
Reply to author
Forward
0 new messages