Which connection variables can you set per host in inventory?

BeginnerConceptInventory
Answer

The common ones:

  • ansible_host — real address/DNS name if different from the inventory name
  • ansible_port, ansible_user, ansible_password
  • ansible_ssh_private_key_file
  • ansible_connection — ssh, local, winrm, docker…
  • ansible_become, ansible_become_user, ansible_become_method
  • ansible_python_interpreter
  • ansible_ssh_common_args — e.g. a ProxyJump through a bastion
db1 ansible_host=10.0.2.5 ansible_user=ec2-user ansible_ssh_private_key_file=~/.ssh/prod.pem
All Ansible questions Roadmap: Ansible

More on Inventory