12/14/2023 0 Comments Bastion switch targeting issue![]() ![]() ESTABLISH SSH CONNECTION FOR USER: ubuntu Task path: /path/to/dir/enable-ansible.yml:2 Loading callback plugin default of type stdout, v2.0 from /usr/lib/python2.7/dist-packages/ansible/plugins/callback/default.pyc Statically imported: /path/to/dir/tasks/ansible.yml : Found both group and host with same name: server2 path/to/dir/hosts inventory source with ini plugin path/to/dir/hosts did not meet script requirements, check plugin documentation if this is unexpected path/to/dir/hosts did not meet host_list requirements, check plugin documentation if this is unexpected ![]() Using /path/to/dir/ansible.cfg as config file ![]() This is the result when I run -vvvv (with some path and names obfuscated): ansible-playbook 2.7.5Ĭonfigured module search path = Īnsible python module location = /usr/lib/python2.7/dist-packages/ansibleĮxecutable location = /usr/bin/ansible-playbook What should I do to make Ansible jump through bastion and then server1 so that it can reach server2? Neither work, and both result in a timeout. I've tried: ansible_ssh_common_args='-o Prox圜ommand="ssh -J bastion,server1"'Īnd ansible_ssh_common_args='-o Prox圜ommand="ssh -W %h:%p -q bastion ssh -W %h:%p -q server1"' So that seems to be working.īut, I do not know how to change the hosts file to jump through both of these hosts. This allows me to type ssh server2 and open a shell inside server2. I've added the following to ~/.ssh/config: Host server2 However, I now also need to do this through two hosts. I have also updated my ~/.ssh/config file: Host bastion I'm able to get Ansible to jump through one host into server1 by adding this to my hosts file: Īnsible_ssh_common_args='-o Prox圜ommand="ssh -W %h:%p -q bastion"' I want to write an Ansible playbook (using Ansible 2.7.5) that will jump through two hosts before reaching the intended server to do things such as install docker and python, etc. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |