Skip to content

Instantly share code, notes, and snippets.

@tkellen
Created January 31, 2016 15:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tkellen/199a87526b2ebb9d29cd to your computer and use it in GitHub Desktop.
Save tkellen/199a87526b2ebb9d29cd to your computer and use it in GitHub Desktop.
ansible bastion host configuration via extra-vars
host_key_checking: true
host_key_checking_option: "{{ (host_key_checking == true) | ternary('','-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no') }}"
bastion_host: false
bastion_user: "{{ lookup('env', 'USER') }}"
bastion_ssh_arg: -o ProxyCommand='ssh {{host_key_checking_option}} -W %h:%p -q {{bastion_user}}@{{bastion_host}}' {{host_key_checking_option}}
ansible_ssh_extra_args: "{{ bastion_host | ternary(bastion_ssh_arg, '') }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment