Advertisement
eric-sysmin

Untitled

Oct 10th, 2016
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. ---
  2. - hosts: localhost
  3. tasks:
  4. - name: "Get NIC Model for {{ item }}"
  5. shell: "lshw -class network -short | grep {{ item }} | awk '{ print $4 }'"
  6. register: "{{ item }}"
  7. with_items:
  8. - ens33
  9. - debug: msg="{{ ens33.stdout }}"
  10.  
  11.  
  12. ################################################################
  13. TASK [Get NIC Model for {{ item }}] ********************************************
  14. changed: [localhost] => (item=ens33)
  15.  
  16. TASK [debug] *******************************************************************
  17. 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