Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- - hosts: localhost
- tasks:
- - name: "Get NIC Model for {{ item }}"
- shell: "lshw -class network -short | grep {{ item }} | awk '{ print $4 }'"
- register: "{{ item }}"
- with_items:
- - ens33
- - debug: msg="{{ ens33.stdout }}"
- ################################################################
- TASK [Get NIC Model for {{ item }}] ********************************************
- changed: [localhost] => (item=ens33)
- TASK [debug] *******************************************************************
- fatal: [localhost]: FAILED! => {"failed": true, "msg": "the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: 'ens33' is undefined\n\nThe error appears to have been in '/home/eanderson/Documents/verizon/test.yml': line 9, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n - ens33\n - debug: msg=\"{{ ens33.stdout }}\"\n ^ here\nWe could be wrong, but this one looks like it might be an issue with\nmissing quotes. Always quote template expression brackets when they\nstart a value. For instance:\n\n with_items:\n - {{ foo }}\n\nShould be written as:\n\n with_items:\n - \"{{ foo }}\"\n"}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement