Created
January 31, 2016 15:55
-
-
Save tkellen/199a87526b2ebb9d29cd to your computer and use it in GitHub Desktop.
ansible bastion host configuration via extra-vars
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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