# Setting a Password in Ansible Inventory File

Generally, we shouldn't be needing this, as one should have a SSH key pair to access remote servers for enhanced security, and convenience, but there might be scenarios where you need to use password authentication. This can be be useful in development or testing environments, but it's prudent to avoid this practice in production.

## Example Inventory File

```toml
[vm]
vagrant ansible_host=10.0.0.2 ansible_user=vagrant ansible_ssh_pass=vagrant
```

***Source:*** [***Serverfault***](https://serverfault.com/a/742382)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://til.devjugal.com/ansible/setting-a-password-in-ansible-inventory-file.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
