Advertisement
sandervanvugt

complex lab stage 2

May 19th, 2022
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. ---
  2. - name: complicated
  3. hosts: all
  4. tasks:
  5. - name: check if second disk exists
  6. fail:
  7. msg: getting out because we don't have a second disk on this host - further investigage
  8. when: ansible_facts['devices']['nvme0n2'] is not defined
  9. - name: create the partition with parted module
  10. debug:
  11. msg: using parted to create the partition
  12. - name: create the volume group on top of partition lvg module
  13. debug:
  14. msg: createing the vg with lvg
  15. - name: updating the facts
  16. setup:
  17. - name: rephrasing
  18. debug:
  19. msg: use when to see if we are bigger than 5 GB
  20. when: ansible_fact['devices']['nvme0n1p1']['size'] > 5
  21. - name: create lvm if smaller than 5gb with lvol module
  22. debug:
  23. msg: use when to see if we are smaller than 5 GB
  24. when: ansible_fact['devices']['nvme0n1p1']['size'] < 5
  25. - name: blah
  26. debug:
  27. msg: format new partition with filesystem module
  28. - name: making dir
  29. debug:
  30. msg: use file to create the mountpoint directory
  31. - name: mount using mount
  32. debug:
  33. msg: mounting the fs
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement