](https://gagor.pro/generic-cover.webp)
Use bastion host with Ansible
Learn how to configure Ansible to connect to hosts behind a bastion or jump host by customizing your ssh_config and ansible.cfg files.
](https://gagor.pro/generic-cover.webp)
Learn how to configure Ansible to connect to hosts behind a bastion or jump host by customizing your ssh_config and ansible.cfg files.
](https://gagor.pro/generic-cover.webp)
I have some Ansible roles to configure my vps, Raspberry Pi, etc. I like to test them before I broke something on my real, not clustered machines - I use Vagrant for that. But with it I had one problem - in playbooks I define hosts as groups of severs ex. web for my vps: Example Ansible playbook - hosts: web gather_facts: True sudo: True ... But testing machine wasn’t in this group and when I run vagrant I could only see: ...
](https://gagor.pro/generic-cover.webp)
In recent Ansible update to 1.5 version there is really nice feature ssh pipelining. This option is serious alternative to accelerated mode. Just add to you config file (ex. ~/.ansible.cfg): [ssh_connection] pipelining=True Now run any playbook - you will see the difference 😄 Source (and extended info about): http://blog.ansibleworks.com/2014/01/15/ssh-connection-upgrades-coming-in-ansible-1-5/ external link
](https://gagor.pro/generic-cover.webp)
I was configuring GlusterFS on few servers using Ansible external link and have a need to update /etc/hosts with hostnames for easier configuration. I found this1 one working: - name: Update /etc/hosts lineinfile: dest=/etc/hosts regexp='.*{{item}}$' line='{{hostvars.{{item}}.ansible_default_ipv4.address}} {{item}}' state=present with_items: '{{groups.somegroup}}' http://xmeblog.blogspot.com/2013/06/ansible-dynamicaly-update-etchosts.html external link ↩︎