Advertisement
eric-sysmin

Untitled

Oct 10th, 2016
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.41 KB | None | 0 0
  1. # ansible-playbook test.yml -e "int1=ens33 int2=lo0"
  2. ---
  3. - hosts: localhost
  4.   tasks:
  5.     - name: "Get NIC Model for {{ item }}"
  6.       shell: "lshw -class network -short | grep {{ item }} | awk '{ print $4 }'"
  7.       register: "{{ item }}-details"
  8.       with_items:
  9.        - "{{ int1 }}"
  10.         - "{{ int2 }}"
  11.     - debug: msg="{{ {{ item }}-details.stdout }}"
  12.       with_items:
  13.         - "{{ int1 }}"
  14.         - "{{ int2 }}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement