I have the following two ymls:
---
- hosts: localhost
vars:
- username: test
tasks:
- name: Include User
include: 'user.yml'
become: true
---
- name: Create user '{{ username }}'
user:
name: '{{ username }}'
password: 'password...'
become: true
I got the error message below:
$ ansible-playbook main.yml
fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "sudo: a password is required\n", "module_stdout": "", "msg": "MODULE FAILURE", "rc": 1}
I do not want to pass my password during the execution. Is it possible to run the script without asking password from the executor?
If so, how can I alter the ansible descriptor accordingly?
Ansible 2.6.1
Ubuntu 18.04 LTS