Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- - name: setup additional storage
- gather_facts: yes
- hosts: all
- tasks:
- - name: DEBUG - show disk device facts
- debug:
- var: ansible_facts['devices']
- - name:
- fail:
- msg: device sdb not present
- when: ansible_facts['devices']['sdb'] is not defined
- - name: actions when /dev/sdb is present
- block:
- - name: DEBUG - disk partititon
- debug:
- msg: parted - create a single partition spanning /dev/sdb
- - name: DEBUG - setup LVM PV and VG
- debug:
- msg: lvg - create an LVM VG vgfiles using /dev/sdb1 partition
- - name: DEBUG - we have a smaller VG
- debug:
- msg: lvol - create LV lvfiles that is 3GB
- # Dummy value for logic test
- when: 4 <= 5
- - name: DEBUG - we have a larger VG
- debug:
- msg: lvol - create LV lvfiles that is 6GB
- # Dummy value for logic test
- when: 12 > 5
- - name: DEBUG - format filesystem
- debug:
- msg: filesystem - format lvfiles using xfs
- - name: DEBUG - /files mountpoint
- debug:
- msg: file - create dir /files for mount point
- - name: DEBUG - mount filesystem
- debug:
- msg: mount - add /etc/fstab entry for /files referencing lvfiles LV with XFS
- when: ansible_facts['devices']['sdb'] is defined
Advertisement
Add Comment
Please, Sign In to add comment