Skip to content

Commit

Permalink
Merge pull request #10 from hopkins-tk/hopkins-tk/9
Browse files Browse the repository at this point in the history
feat: do not create LVM when docker_block_device is undefined
  • Loading branch information
ericsysmin authored Feb 8, 2018
2 parents 4507589 + e2c4256 commit 9be2df7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tasks/storage_drivers/devicemapper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@

- name: Docker | Storage Driver | devicemapper | Configure logical volume group
lvg: vg=docker pvs="{{ docker_block_device }}"
when: docker_block_device is defined

- name: Docker | Storage Driver | devicemapper | Create thinpool volume
lvol: vg=docker lv=thinpool size=95%VG opts="--wipesignatures y"
register: thinpool
when: docker_block_device is defined

- name: Docker | Storage Driver | devicemapper | Create thinpoolmeta volume
lvol: vg=docker lv=thinpoolmeta size=1%VG opts="--wipesignatures y"
when: docker_block_device is defined

- name: Docker | Storage Driver | devicemapper | Convert volumes to thinpool
shell: lvconvert -y --zero n -c 512K --thinpool docker/thinpool --poolmetadata docker/thinpoolmeta
Expand All @@ -29,6 +32,7 @@
copy: src=docker-thinpool.profile dest=/etc/lvm/profile/docker-thinpool.profile
register: docker_thinpool_profile
notify: Docker | Restart Docker
when: docker_block_device is defined

- name: Docker | Storage Driver | devicemapper | Apply 'lvm' profile
shell: lvchange --metadataprofile docker-thinpool docker/thinpool
Expand Down

0 comments on commit 9be2df7

Please sign in to comment.