-
-
Save aubs/d15aa75bef115f70a4fcd096d66fe991 to your computer and use it in GitHub Desktop.
Revisions
-
mrlesmithjr revised this gist
Sep 9, 2015 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -49,6 +49,7 @@ - name: creating new LVM logical volume lvol: vg={{ create_vgname }} lv={{ create_lvname }} size={{ create_lvsize }} when: create and config_lvm - name: creating new filesystem on new LVM logical volume filesystem: fstype={{ filesystem }} dev=/dev/{{ create_vgname }}/{{ create_lvname }} -
mrlesmithjr revised this gist
Mar 31, 2015 . 1 changed file with 17 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -23,9 +23,25 @@ apt: name=lvm2 state=present when: config_lvm and ansible_os_family == "Debian" - name: installing lvm2 yum: name=system-storage-manager state=present when: config_lvm and ansible_os_family == "RedHat" - name: installing scsitools apt: name=scsitools state=present when: config_lvm and ansible_os_family == "Debian" - name: installing sg3_utils yum: name=sg3_utils state=present when: config_lvm and ansible_os_family == "RedHat" - name: rescanning for new disks command: /sbin/rescan-scsi-bus when: config_lvm and ansible_os_family == "Debian" - name: rescanning for new disks command: /usr/bin/rescan-scsi-bus.sh when: config_lvm and ansible_os_family == "RedHat" - name: creating new LVM volume group lvg: vg={{ create_vgname }} pvs={{ new_disk }} state=present -
mrlesmithjr revised this gist
Mar 31, 2015 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,8 @@ --- - hosts: db-vms # set to specific inventory host group or set to all for every host in inventory for play vars: config_lvm: false # must be set to true in order to execute any tasks in play (failsafe option :)- ) create: false # set to true if creating a new logical volume (do not set extend or resize to true) resize: false # set to true if resizing the logical volume (do not set create to true) extend: false # set to true if extending the logical volume (do not set create to true) current_disk: '/dev/sda5' # set to your current disk device already setup in lvm -
mrlesmithjr created this gist
Mar 31, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,55 @@ --- - hosts: db-vms # set to specific inventory host group or set to all for every host in inventory for play vars: config_lvm: true # must be set to true in order to execute any tasks in play (failsafe option :)- ) create: true # set to true if creating a new logical volume (do not set extend or resize to true) resize: false # set to true if resizing the logical volume (do not set create to true) extend: false # set to true if extending the logical volume (do not set create to true) current_disk: '/dev/sda5' # set to your current disk device already setup in lvm new_disk: '/dev/sdb' # set to new disk being added to volume group new_mntp: '/var/lib/mysql' # set to the desired mount point to be created and new logical volume to be mounted to create_vgname: 'mysql-vg' # set to volume group name to create resize_vgname: 'test-vg' # set to volume group name to resize extend_vgname: 'test-vg' # set to volume group name to extend create_lvname: 'mysql-lv' # set to logical volume name to create resize_lvname: 'test-lv' # set to logical volume name to resize extend_lvname: 'test-lv' # set to logical volume name to extend create_lvsize: '100%FREE' # set to logical volume size to create --- (10G) - would create new lvm with 10Gigabytes -- (512) - would create new lvm with 512m extend_disks: '{{ current_disk }},{{ new_disk }}' # first disk is current volume group lvextend_options: '-L+10G' # setting the options to pass to lvextend --- ('-L+10G') - would increase by 10GB whereas ('-l +100%FREE') would increase to full capacity filesystem: 'ext4' # set to filesystem type to format new logical volume with ( ext3, ext4, xfs, etc. ) tasks: - name: installing lvm2 apt: name=lvm2 state=present when: config_lvm and ansible_os_family == "Debian" - name: install lvm2 yum: name=system-storage-manager state=present when: config_lvm and ansible_os_family == "RedHat" - name: creating new LVM volume group lvg: vg={{ create_vgname }} pvs={{ new_disk }} state=present when: create and config_lvm - name: creating new LVM logical volume lvol: vg={{ create_vgname }} lv={{ create_lvname }} size={{ create_lvsize }} - name: creating new filesystem on new LVM logical volume filesystem: fstype={{ filesystem }} dev=/dev/{{ create_vgname }}/{{ create_lvname }} when: create and config_lvm - name: mounting new filesystem mount: name={{ new_mntp }} src=/dev/{{ create_vgname }}/{{ create_lvname }} fstype={{ filesystem }} state=mounted when: create and config_lvm - name: extending existing LVM volume group lvg: vg={{ extend_vgname }} pvs={{ extend_disks }} when: extend and config_lvm - name: extending existing filesystem command: lvextend {{ lvextend_options }} /dev/{{ extend_vgname }}/{{ extend_lvname }} when: extend and config_lvm - name: resizing filesystem command: resize2fs /dev/{{ resize_vgname }}/{{ resize_lvname }} when: resize and config_lvm