Created
May 24, 2017 16:30
-
-
Save oboukili/576ff970308819bc15765c8c107a6728 to your computer and use it in GitHub Desktop.
playbook + invocation + output
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| - hosts: infrastructure | |
| become: true | |
| pre_tasks: | |
| - name: debug | |
| debug: | |
| msg: "{{ hostvars[item] }}" | |
| with_items: "{{ groups['infrastructure'] }}" | |
| ... | |
| ## Invocation: | |
| ansible-playbook -i ~/Workspaces/ansible-inventory/mycloud includes/test.yml | |
| ## Output: | |
| PLAY [infrastructure] *********************************************************************************************************************************************************************************************** | |
| TASK [Gathering Facts] ********************************************************************************************************************************************************************************************** | |
| ok: [apps-public1] | |
| ok: [bastion] | |
| TASK [debug] ******************************************************************************************************************************************************************************************************** | |
| fatal: [apps-public1]: FAILED! => {"failed": true, "msg": "the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: 'ansible.vars.hostvars.HostVars object' has no attribute u'apps-public1'\n\nThe error appears to have been in '/home/bki/Workspaces/playbooks/test.yml': line 5, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n pre_tasks:\n - name: debug\n ^ here\n"} | |
| fatal: [bastion]: FAILED! => {"failed": true, "msg": "the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: 'ansible.vars.hostvars.HostVars object' has no attribute u'apps-public1'\n\nThe error appears to have been in '/home/bki/Workspaces/playbooks/test.yml': line 5, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n pre_tasks:\n - name: debug\n ^ here\n"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment