You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ansible-playbook --syntax-check create-user.yml -e "hosts=test user_name=test"
ERROR! The field 'hosts' has an invalid value, which includes an undefined variable. The error was: 'inventory' is undefined
The error appears to be in '/etc/ansible/create-user.yml': line 5, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
hosts: '{{inventory}}'
^ here
We could be wrong, but this one looks like it might be an issue with
missing quotes. Always quote template expression brackets when they
start a value. For instance:
with_items:
- {{ foo }}
Should be written as:
with_items:
- "{{ foo }}"
The text was updated successfully, but these errors were encountered:
PLAY [test] *****************************************************************************************************************
TASK [Gathering Facts] ******************************************************************************************************
fatal: [192.168.2.12]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: no such identity: .vagrant/machines/test_box/virtualbox/private_key: No such file or directory\r\nPermission denied (publickey,gssapi-keyex,gssapi-with-mic,password).", "unreachable": true}
ansible-playbook --syntax-check create-user.yml -e "hosts=test user_name=test"
ERROR! The field 'hosts' has an invalid value, which includes an undefined variable. The error was: 'inventory' is undefined
The error appears to be in '/etc/ansible/create-user.yml': line 5, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
hosts: '{{inventory}}'
^ here
We could be wrong, but this one looks like it might be an issue with
missing quotes. Always quote template expression brackets when they
start a value. For instance:
with_items:
- {{ foo }}
Should be written as:
The text was updated successfully, but these errors were encountered: