Skip to content

Instantly share code, notes, and snippets.

@mgedmin
Created October 27, 2015 13:05
Show Gist options
  • Save mgedmin/10ab60914ff8c2284e28 to your computer and use it in GitHub Desktop.
Save mgedmin/10ab60914ff8c2284e28 to your computer and use it in GitHub Desktop.
ansible.cfg for use with vagrant
# ansible config file for use with Vagrant
[defaults]
inventory = .vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory
remote_user = vagrant
private_key_file = ~/.vagrant.d/insecure_private_key
host_key_checking = false
# NB: host_key_checking prevents connection errors from changed host keys,
# but mismatched host keys disable ForwardAgent and make some git clones hang
gathering = smart
fact_caching = jsonfile
fact_caching_connection = .cache/facts/
fact_caching_timeout = 86400
[privilege_escalation]
become = true
[ssh_connection]
# I want two extra things here: agent forwarding (NB: use -o ForwardAgent=yes
# instead of -A, since these arguments are also used for scp invocations) and
# -o UserKnownHostsFile=/dev/null. The ControlMaster/ControlPersist stuff is
# copied from the default ssh_args, since losing them would slow things down.
ssh_args = -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o UserKnownHostsFile=/dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment