Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- - name: complicated
- hosts: all
- tasks:
- - name: check if second disk exists
- fail:
- msg: getting out because we don't have a second disk on this host - further investigage
- when: ansible_facts['devices']['nvme0n2'] is not defined
- - name: create the partition with parted module
- debug:
- msg: using parted to create the partition
- - name: create the volume group on top of partition lvg module
- debug:
- msg: createing the vg with lvg
- - name: updating the facts
- setup:
- - name: rephrasing
- debug:
- msg: use when to see if we are bigger than 5 GB
- when: ansible_fact['devices']['nvme0n1p1']['size'] > 5
- - name: create lvm if smaller than 5gb with lvol module
- debug:
- msg: use when to see if we are smaller than 5 GB
- when: ansible_fact['devices']['nvme0n1p1']['size'] < 5
- - name: blah
- debug:
- msg: format new partition with filesystem module
- - name: making dir
- debug:
- msg: use file to create the mountpoint directory
- - name: mount using mount
- debug:
- msg: mounting the fs
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement