I feel like this should be the EASY part, but - we are calling an Ansible playbook to create username/password on a Linux box.
Running the playbook from another machine as such works fine:
ansible-playbook /etc/ansible/roles/foo/userplaybook.yaml -l IPADDRESS, -e "user=Username password=Password" -u logonusername -b
But with the following in our Template...
username: logonusername
password: logonusernamepassword
playbooks:
provision:
- /etc/ansible/roles/foo/userplaybook.yaml --extra-vars "user=Username password=Password!"
We get the following error, as if it is not passing the extra variables at all:
FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'user' is undefined\n\nThe error appears to be in '/etc/ansible/roles/foo/tasks/main.yml
We've tried sending the -e as above, and as JSON format, with extra single quotes, who knows how many other things.
Any ideas where the problem lies? The fact we're calling the playbook is a good start, but from there, this looks like it's supposed to be the easy part, yet somehow we're not sending what we think we are?