Advertisement
sandervanvugt

check-if-disk yaml code

Oct 28th, 2021
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. [ansible@control lesson9]$ cat jw.yaml
  2. ---
  3. - name: Check disks
  4. hosts: all
  5. tasks:
  6. - shell: lsblk
  7. register: block_listing
  8. - debug:
  9. msg: echo "You have a second disk"
  10. #when: '"sdb" in ansible_facts.devices'
  11. #when: ansible_facts.devices.sdb is defined or ansible_facts.devices.vdb is defined
  12. when: '"sdb" in block_listing.stdout'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement