If you need to use password-based authentication in order to connect to the nodes, you need to append the option ansible_become_pass to your Ansible command.
Here's how you can do it:
1. Open your Ansible inventory file (inventory.ini) or create one if it doesn't exist.
2. Add the target hosts to the inventory file. For example:
3. Create a playbook file (e.g., playbook.yml) and define your tasks and hosts.
4. Specify the ansible_become_pass variable in the playbook file to provide the sudo password. For example:
- name: Example Playbook
- name: Your task name
Replace your_sudo_password with the actual sudo password you want to use.
5. Save the playbook file and run the Ansible command to execute it. For example:
ansible-playbook -i inventory.ini playbook.yml
Ansible will use the specified sudo password (ansible_become_pass) when executing tasks that require elevated privileges on the target hosts.