Merge pull request #38 from mrlesmithjr/issue-37

Issue 37
This commit is contained in:
Larry Smith Jr
2020-05-14 09:52:39 -04:00
committed by GitHub
13 changed files with 230 additions and 326 deletions

View File

@@ -1,322 +1,322 @@
commit 881d5d77fa435ccaa026c3341d0d2ac1fb537b98 commit 881d5d77fa435ccaa026c3341d0d2ac1fb537b98
Author: Larry Smith Jr <mrlesmithjr@gmail.com> Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Mon Apr 27 11:26:18 2020 -0400 Date: Mon Apr 27 11:26:18 2020 -0400
Fixing syntax issue for wantlist Fixing syntax issue for wantlist
commit 89360e3ffef9ff1dbbb5ad525a7ee1d77e6b8895 commit 89360e3ffef9ff1dbbb5ad525a7ee1d77e6b8895
Author: Larry Smith Jr <mrlesmithjr@gmail.com> Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Mon Apr 27 11:16:02 2020 -0400 Date: Mon Apr 27 11:16:02 2020 -0400
Trying to fix the subelements lookup for a single element Trying to fix the subelements lookup for a single element
This addresses #42. Will need to do some validation testing, etc. This addresses #42. Will need to do some validation testing, etc.
commit c6a7034e4b0b381c5c5b44a15ce7baad7eab9c1b commit c6a7034e4b0b381c5c5b44a15ce7baad7eab9c1b
Author: Charlie Mordant <cmordant1@gmail.com> Author: Charlie Mordant <cmordant1@gmail.com>
Date: Fri Apr 24 17:22:07 2020 +0200 Date: Fri Apr 24 17:22:07 2020 +0200
remove unused molecule env property remove unused molecule env property
commit 883055c33f2d6b4c0df8e61ce49771c451905334 commit 883055c33f2d6b4c0df8e61ce49771c451905334
Author: Charlie Mordant <cmordant1@gmail.com> Author: Charlie Mordant <cmordant1@gmail.com>
Date: Thu Apr 23 19:38:35 2020 +0200 Date: Thu Apr 23 19:38:35 2020 +0200
lint lint
commit 325c2d6240022fe17abf40dffee842ccf79543f1 commit 325c2d6240022fe17abf40dffee842ccf79543f1
Author: Charlie Mordant <cmordant1@gmail.com> Author: Charlie Mordant <cmordant1@gmail.com>
Date: Thu Apr 23 19:25:09 2020 +0200 Date: Thu Apr 23 19:25:09 2020 +0200
install xfs install xfs
commit 4a1177e420fd9632f77d07ce0a19f89a1515f8eb commit 4a1177e420fd9632f77d07ce0a19f89a1515f8eb
Author: Charlie Mordant <cmordant1@gmail.com> Author: Charlie Mordant <cmordant1@gmail.com>
Date: Tue Apr 21 19:01:29 2020 +0200 Date: Tue Apr 21 19:01:29 2020 +0200
use xfs_info on mountpoint instead of lvm use xfs_info on mountpoint instead of lvm
commit 7fd5a8eec9f4b5110929862056ab88c4db3f14de commit 7fd5a8eec9f4b5110929862056ab88c4db3f14de
Author: Larry Smith Jr <mrlesmithjr@gmail.com> Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Sun Apr 19 01:59:29 2020 -0400 Date: Sun Apr 19 01:59:29 2020 -0400
Only doing a Molecule lint at this time Only doing a Molecule lint at this time
commit 7e2a076b0a8155015fd21502db860fa89a2114b3 commit 7e2a076b0a8155015fd21502db860fa89a2114b3
Author: Larry Smith Jr <mrlesmithjr@gmail.com> Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Sun Apr 19 01:44:38 2020 -0400 Date: Sun Apr 19 01:44:38 2020 -0400
Added Python requirements for testing, etc. Added Python requirements for testing, etc.
Closes #33 Closes #33
commit dadb9f24f7ebc2752e6495c4c3569bdee5e0cc68 commit dadb9f24f7ebc2752e6495c4c3569bdee5e0cc68
Author: Charlie Mordant <cmordant1@gmail.com> Author: Charlie Mordant <cmordant1@gmail.com>
Date: Fri Apr 17 13:12:06 2020 +0200 Date: Fri Apr 17 13:12:06 2020 +0200
remove unwanted files remove unwanted files
commit 2f63eab727cf7b0b389d0d0cc1a1c7236b71f839 commit 2f63eab727cf7b0b389d0d0cc1a1c7236b71f839
Author: Charlie Mordant <cmordant1@gmail.com> Author: Charlie Mordant <cmordant1@gmail.com>
Date: Fri Apr 17 12:56:31 2020 +0200 Date: Fri Apr 17 12:56:31 2020 +0200
code smells code smells
commit 050f8a56f10d81f7827be53b8c769b1aa5021c00 commit 050f8a56f10d81f7827be53b8c769b1aa5021c00
Author: Charlie Mordant <cmordant1@gmail.com> Author: Charlie Mordant <cmordant1@gmail.com>
Date: Wed Apr 15 19:08:34 2020 +0200 Date: Wed Apr 15 19:08:34 2020 +0200
typo in check typo in check
commit b955a6f073b91773f5f90da878268e74872a99e9 commit b955a6f073b91773f5f90da878268e74872a99e9
Author: Charlie Mordant <cmordant1@gmail.com> Author: Charlie Mordant <cmordant1@gmail.com>
Date: Wed Apr 15 18:54:17 2020 +0200 Date: Wed Apr 15 18:54:17 2020 +0200
remove unwanted newline remove unwanted newline
commit f81937e9d82bc48f2ee03f6ff462c32bca3da8f0 commit f81937e9d82bc48f2ee03f6ff462c32bca3da8f0
Author: Charlie Mordant <cmordant1@gmail.com> Author: Charlie Mordant <cmordant1@gmail.com>
Date: Wed Apr 15 18:52:52 2020 +0200 Date: Wed Apr 15 18:52:52 2020 +0200
makes xfs mountpoint repeatable makes xfs mountpoint repeatable
commit 1c3818e5d06887c01dc0a4b88a39c0561a446300 commit 1c3818e5d06887c01dc0a4b88a39c0561a446300
Author: Charlie Mordant <cmordant1@gmail.com> Author: Charlie Mordant <cmordant1@gmail.com>
Date: Wed Apr 15 17:34:53 2020 +0200 Date: Wed Apr 15 17:34:53 2020 +0200
mistake on remove volume mistake on remove volume
commit 47f8dae16a096050dccbb8d161f4a18946a6ae73 commit 47f8dae16a096050dccbb8d161f4a18946a6ae73
Author: Charlie Mordant <cmordant1@gmail.com> Author: Charlie Mordant <cmordant1@gmail.com>
Date: Wed Apr 15 17:13:38 2020 +0200 Date: Wed Apr 15 17:13:38 2020 +0200
github action lint github action lint
commit 96fa78d6d099d0a48642d377d3e7f30a0c554bdf commit 96fa78d6d099d0a48642d377d3e7f30a0c554bdf
Author: Charlie Mordant <cmordant1@gmail.com> Author: Charlie Mordant <cmordant1@gmail.com>
Date: Wed Apr 15 17:07:33 2020 +0200 Date: Wed Apr 15 17:07:33 2020 +0200
remove deprecated machines remove deprecated machines
commit 17e8ec1058c5cb66b21b15a8d3912ac9980508a9 commit 17e8ec1058c5cb66b21b15a8d3912ac9980508a9
Author: Charlie Mordant <cmordant1@gmail.com> Author: Charlie Mordant <cmordant1@gmail.com>
Date: Wed Apr 15 16:56:18 2020 +0200 Date: Wed Apr 15 16:56:18 2020 +0200
configured molecule and fix xfs on centos configured molecule and fix xfs on centos
commit ba5d929fce982af9baa44cfe8ad0b3079133f444 commit ba5d929fce982af9baa44cfe8ad0b3079133f444
Author: Charlie Mordant <cmordant1@gmail.com> Author: Charlie Mordant <cmordant1@gmail.com>
Date: Wed Apr 15 15:14:30 2020 +0200 Date: Wed Apr 15 15:14:30 2020 +0200
use dots instead of carets use dots instead of carets
commit ea9109220bb268b5f14e75e38d9fb32c2d79bae5 commit ea9109220bb268b5f14e75e38d9fb32c2d79bae5
Author: Charlie Mordant <cmordant1@gmail.com> Author: Charlie Mordant <cmordant1@gmail.com>
Date: Wed Apr 15 14:33:41 2020 +0200 Date: Wed Apr 15 14:33:41 2020 +0200
molecule test and idempotence molecule test and idempotence
commit d8b3a4e93257dfeb79bc8d4ef349acb53f0019dc commit d8b3a4e93257dfeb79bc8d4ef349acb53f0019dc
Author: Samuel Mutel <smu-dw@deveryware.net> Author: Samuel Mutel <smu-dw@deveryware.net>
Date: Mon Oct 14 12:21:03 2019 +0200 Date: Mon Oct 14 12:21:03 2019 +0200
bug: Resize XFS parts is not working bug: Resize XFS parts is not working
commit b15ecea51d0045a89aae24e4b0c108b35f060b2c commit b15ecea51d0045a89aae24e4b0c108b35f060b2c
Author: Tony Peña <emperor.cu@gmail.com> Author: Tony Peña <emperor.cu@gmail.com>
Date: Wed Jun 26 14:56:13 2019 +0200 Date: Wed Jun 26 14:56:13 2019 +0200
Update debian.yml Update debian.yml
Since ansible 2.8.0 must be change way using dict Since ansible 2.8.0 must be change way using dict
commit 9788ee5df68798ad94f11c8133b1d62ff409d0e8 commit 9788ee5df68798ad94f11c8133b1d62ff409d0e8
Author: Michele Caputo <mikap83@gmail.com> Author: Michele Caputo <mikap83@gmail.com>
Date: Mon Apr 8 14:16:04 2019 +0200 Date: Mon Apr 8 14:16:04 2019 +0200
issue #23: extra parenthesis issue #23: extra parenthesis
commit 0f428a0e40d71aea410fbc1aa329203c0b4f15cd commit 0f428a0e40d71aea410fbc1aa329203c0b4f15cd
Author: faisalnizam <faisal@logiik.com> Author: faisalnizam <faisal@logiik.com>
Date: Tue Mar 26 10:48:45 2019 +0400 Date: Tue Mar 26 10:48:45 2019 +0400
FIX LINT FOR BUILD FIX LINT FOR BUILD
FIX LINT FOR BUILD FIX LINT FOR BUILD
commit 8957630c04b8befa99c08ed667e43d95198202ce commit 8957630c04b8befa99c08ed667e43d95198202ce
Author: faisalnizam <faisal@logiik.com> Author: faisalnizam <faisal@logiik.com>
Date: Tue Mar 26 10:40:11 2019 +0400 Date: Tue Mar 26 10:40:11 2019 +0400
Adding SWAP FileSystem Exception Adding SWAP FileSystem Exception
Adding Check for SWAP Filesystem if defined skip Adding Check for SWAP Filesystem if defined skip
1. SKIP New Filesystem Creation 1. SKIP New Filesystem Creation
2. SKIP mountpoint check 2. SKIP mountpoint check
commit 183087e767cbce08ce2da1a3b04f47d3fc03a7e6 commit 183087e767cbce08ce2da1a3b04f47d3fc03a7e6
Author: Larry Smith Jr <mrlesmithjr@gmail.com> Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Tue Apr 2 08:03:42 2019 -0400 Date: Tue Apr 2 08:03:42 2019 -0400
Resolves #21 Resolves #21
commit b3ef85d4f738597260d9db0d90e84d0f8721259a commit b3ef85d4f738597260d9db0d90e84d0f8721259a
Author: Larry Smith Jr <mrlesmithjr@gmail.com> Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Wed Dec 5 08:39:10 2018 -0500 Date: Wed Dec 5 08:39:10 2018 -0500
Added skip codes for ansible-lint Added skip codes for ansible-lint
commit 9f4afa7afb3fedc270c44ff1fa357da4b87845c0 commit 9f4afa7afb3fedc270c44ff1fa357da4b87845c0
Author: Larry Smith Jr <mrlesmithjr@gmail.com> Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Wed Dec 5 08:00:13 2018 -0500 Date: Wed Dec 5 08:00:13 2018 -0500
Fixing Travis testing and yamllint issues Fixing Travis testing and yamllint issues
commit 5603c5f6b0899a1b2cdeeeb3c035eb6249e96fa7 commit 5603c5f6b0899a1b2cdeeeb3c035eb6249e96fa7
Author: Larry Smith Jr <mrlesmithjr@gmail.com> Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Wed Dec 5 07:51:31 2018 -0500 Date: Wed Dec 5 07:51:31 2018 -0500
Added Travis testing and hooks for galaxy Added Travis testing and hooks for galaxy
commit 563aa1effba936340cbaad9766a49f570292edee commit 563aa1effba936340cbaad9766a49f570292edee
Author: Mark Goddard <mark@stackhpc.com> Author: Mark Goddard <mark@stackhpc.com>
Date: Wed Oct 31 11:42:20 2018 +0000 Date: Wed Oct 31 11:42:20 2018 +0000
Fix indentation Fix indentation
commit 4a58cb36cf6d4dd4bb23e86972658be508cca082 commit 4a58cb36cf6d4dd4bb23e86972658be508cca082
Author: Mark Goddard <mark@stackhpc.com> Author: Mark Goddard <mark@stackhpc.com>
Date: Wed Oct 31 11:16:27 2018 +0000 Date: Wed Oct 31 11:16:27 2018 +0000
Update tasks/manage_lvm.yml Update tasks/manage_lvm.yml
Co-Authored-By: oneswig <stig.github@telfer.org> Co-Authored-By: oneswig <stig.github@telfer.org>
commit a0c784797f538fc5393d75589ac48e86c51e88db commit a0c784797f538fc5393d75589ac48e86c51e88db
Author: Stig Telfer <stig@stackhpc.com> Author: Stig Telfer <stig@stackhpc.com>
Date: Wed Oct 31 10:16:44 2018 +0100 Date: Wed Oct 31 10:16:44 2018 +0100
Support not formatting volumes. Support not formatting volumes.
Logic to make the filesystem attribute optional, in situations where Logic to make the filesystem attribute optional, in situations where
we do not want the volumes formatted. we do not want the volumes formatted.
commit 66368de1d3d2b6712cbf66fc3dd0962705bf86f9 commit 66368de1d3d2b6712cbf66fc3dd0962705bf86f9
Author: David Castellanos <dcastellanos@fintonic.com> Author: David Castellanos <dcastellanos@fintonic.com>
Date: Mon Dec 18 00:33:45 2017 +0100 Date: Mon Dec 18 00:33:45 2017 +0100
Add opts and mopts support Add opts and mopts support
commit 386cc28bdb58886ed492d3438c9cb088d36de161 commit 386cc28bdb58886ed492d3438c9cb088d36de161
Author: Larry Smith Jr <mrlesmithjr@gmail.com> Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Sun Jun 11 14:57:53 2017 -0400 Date: Sun Jun 11 14:57:53 2017 -0400
Addresses issue #10 Addresses issue #10
Signed-off-by: Larry Smith Jr <mrlesmithjr@gmail.com> Signed-off-by: Larry Smith Jr <mrlesmithjr@gmail.com>
commit 0d255cb5ce9e6016a503203c2ed39a70fb0ccd9c commit 0d255cb5ce9e6016a503203c2ed39a70fb0ccd9c
Author: Larry Smith Jr <mrlesmithjr@gmail.com> Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Fri May 5 09:12:25 2017 -0400 Date: Fri May 5 09:12:25 2017 -0400
Fixes issue #8 Fixes issue #8
Signed-off-by: Larry Smith Jr <mrlesmithjr@gmail.com> Signed-off-by: Larry Smith Jr <mrlesmithjr@gmail.com>
commit f2d06d0d46086da0191b4dbde0d420e709e3ea01 commit f2d06d0d46086da0191b4dbde0d420e709e3ea01
Author: Stefan Heimberg <kontakt@stefanheimberg.ch> Author: Stefan Heimberg <kontakt@stefanheimberg.ch>
Date: Thu Apr 6 00:25:55 2017 +0200 Date: Thu Apr 6 00:25:55 2017 +0200
added support for btrfs added support for btrfs
commit 7749d0c62a6e1539aff94c57fd2c0eeaf43dd1a0 commit 7749d0c62a6e1539aff94c57fd2c0eeaf43dd1a0
Author: Kevin Loveland <kevin.loveland@gmail.com> Author: Kevin Loveland <kevin.loveland@gmail.com>
Date: Fri Nov 18 10:26:16 2016 -0800 Date: Fri Nov 18 10:26:16 2016 -0800
Fixed issue with idempotency of lvol module. See ansible-module-extras issue #428 Fixed issue with idempotency of lvol module. See ansible-module-extras issue #428
commit 3ad965237280d534f0aab0027f9ef61701354e8b commit 3ad965237280d534f0aab0027f9ef61701354e8b
Author: Kevin Loveland <kevin.loveland@gmail.com> Author: Kevin Loveland <kevin.loveland@gmail.com>
Date: Thu Nov 17 15:17:26 2016 -0800 Date: Thu Nov 17 15:17:26 2016 -0800
Changes to adjust to removal of bare vars in Ansible 2.2 Changes to adjust to removal of bare vars in Ansible 2.2
commit a82877c290cfe0b62eda90d8874b8e2b62402946 commit a82877c290cfe0b62eda90d8874b8e2b62402946
Author: Larry Smith Jr <mrlesmithjr@gmail.com> Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Sun Oct 2 09:58:47 2016 -0400 Date: Sun Oct 2 09:58:47 2016 -0400
First commit of CHANGELOG First commit of CHANGELOG
Signed-off-by: Larry Smith Jr <mrlesmithjr@gmail.com> Signed-off-by: Larry Smith Jr <mrlesmithjr@gmail.com>
commit 99366fa547faccb0359dd8d3b19cec802640eb95 commit 99366fa547faccb0359dd8d3b19cec802640eb95
Author: Rohit Kothari <rohietkothari@gmail.com> Author: Rohit Kothari <rohietkothari@gmail.com>
Date: Thu Sep 29 17:59:19 2016 -0700 Date: Thu Sep 29 17:59:19 2016 -0700
Replace system-storage-manager with lvm2 in centos Replace system-storage-manager with lvm2 in centos
commit ca1535d774b4e3310fc993841f1f99400612c7a5 commit ca1535d774b4e3310fc993841f1f99400612c7a5
Author: Olivier LOCARD <olivier.locard@deveryware.com> Author: Olivier LOCARD <olivier.locard@deveryware.com>
Date: Fri Sep 23 16:21:07 2016 +0200 Date: Fri Sep 23 16:21:07 2016 +0200
Add xfs_growfs for xfs systemfile type. Add xfs_growfs for xfs systemfile type.
commit bb87fa8dbff5df50ed376db74a6d2b95f64fd745 commit bb87fa8dbff5df50ed376db74a6d2b95f64fd745
Author: Larry Smith Jr <mrlesmithjr@gmail.com> Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Tue Nov 3 10:39:58 2015 -0500 Date: Tue Nov 3 10:39:58 2015 -0500
updated vars and conditionals updated vars and conditionals
commit 49b20e2e4a80581f1c53559ff4073b3384eae28c commit 49b20e2e4a80581f1c53559ff4073b3384eae28c
Author: Larry Smith Jr <mrlesmithjr@gmail.com> Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Tue Nov 3 10:24:54 2015 -0500 Date: Tue Nov 3 10:24:54 2015 -0500
updated when conditions updated when conditions
commit 0232734bed92e976376d4c9f2550b515f72f3d54 commit 0232734bed92e976376d4c9f2550b515f72f3d54
Author: Larry Smith Jr <mrlesmithjr@gmail.com> Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Tue Nov 3 10:22:09 2015 -0500 Date: Tue Nov 3 10:22:09 2015 -0500
updated tasks to only work when lvnames is defined updated tasks to only work when lvnames is defined
commit 9f592112095208843da1fd69a658bd49c163a7bb commit 9f592112095208843da1fd69a658bd49c163a7bb
Author: Larry Smith Jr <mrlesmithjr@gmail.com> Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Tue Nov 3 09:37:38 2015 -0500 Date: Tue Nov 3 09:37:38 2015 -0500
updated vars and meta updated vars and meta
commit 686455514d8bc0da70b3440dbc5afe669188d333 commit 686455514d8bc0da70b3440dbc5afe669188d333
Author: Larry Smith Jr <mrlesmithjr@gmail.com> Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Tue Nov 3 09:22:00 2015 -0500 Date: Tue Nov 3 09:22:00 2015 -0500
cleaned up and fixed all tasks including swap cleaned up and fixed all tasks including swap
commit 9f5c61e25599a130e1625e879438561cc1f6a437 commit 9f5c61e25599a130e1625e879438561cc1f6a437
Author: Larry Smith Jr <mrlesmithjr@gmail.com> Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Mon Nov 2 23:38:38 2015 -0500 Date: Mon Nov 2 23:38:38 2015 -0500
added new task added new task
commit a5103ff6396138f531cf8457f16706b6fc90d1d1 commit a5103ff6396138f531cf8457f16706b6fc90d1d1
Author: Larry Smith Jr <mrlesmithjr@gmail.com> Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Mon Nov 2 23:38:23 2015 -0500 Date: Mon Nov 2 23:38:23 2015 -0500
changing role tasks and vars changing role tasks and vars
commit c776e9f339f0bcfe987aa571d29411ac44a29526 commit c776e9f339f0bcfe987aa571d29411ac44a29526
Author: Larry Smith Jr <mrlesmithjr@gmail.com> Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Mon Nov 2 21:50:07 2015 -0500 Date: Mon Nov 2 21:50:07 2015 -0500
updated meta updated meta
commit 46e0fd1fc2477693fc66aa4b38ac7bde19087047 commit 46e0fd1fc2477693fc66aa4b38ac7bde19087047
Author: Larry Smith Jr <mrlesmithjr@gmail.com> Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Mon Nov 2 21:23:59 2015 -0500 Date: Mon Nov 2 21:23:59 2015 -0500
updated meta updated meta
commit d1d99b2f17d3bc46a479af5d01a976686429b7ce commit d1d99b2f17d3bc46a479af5d01a976686429b7ce
Author: Larry Smith Jr <mrlesmithjr@gmail.com> Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Mon Nov 2 21:23:03 2015 -0500 Date: Mon Nov 2 21:23:03 2015 -0500
first commit first commit

117
README.md
View File

@@ -1,6 +1,6 @@
# Role Name # ansible-manage-lvm
An [Ansible] role to manage LVM Groups/Logical Volumes. Ansible role to manage LVM Groups/Logical Volumes.
> NOTE: Can be used to create, extend or resize LVM Groups and volumes. > NOTE: Can be used to create, extend or resize LVM Groups and volumes.
@@ -9,78 +9,9 @@ An [Ansible] role to manage LVM Groups/Logical Volumes.
Devices/disks to be members of the LVM setup **must be** identified prior to Devices/disks to be members of the LVM setup **must be** identified prior to
using this role. using this role.
> NOTE: Ensure that you select the correct devices/disks.
>
> NOTE: To create an LVM VG w/out creating LVM LVOLS...define lvname w/ var as
> `None` as in the below example.
## Role Variables ## Role Variables
```yaml [defaults/main.yml](defaults/main.yml)
---
# defaults file for ansible-manage-lvm
lvm_groups: []
# - vgname: ubuntu-vg
# disks:
# - /dev/sda5
# - /dev/sdc
# - /dev/sdd
# # defines if VG should exist or be removed
# # true or false
# create: true
# lvnames:
# - lvname: swap_1
# # Define size of lvol
# # 100%FREE, 10g, 1024 (megabytes by default)
# size: 5g
# # Defines additional lvcreate options (e.g. stripes, stripesize, etc)
# opts: ''
# # Defines if lvol should exist or be removed
# # true or false
# create: true
# # Defines filesystem to format lvol as
# filesystem: swap
# # Defines if filesystem should be mounted
# mount: false
# # Defines mountpoint for lvol
# mntp: []
# # Defines additional mount options (e.g. noatime, noexec, etc)
# mopts: ''
# - lvname: root
# size: 40g
# create: true
# filesystem: ext4
# mount: true
# mntp: /
# - vgname: test-vg
# disks:
# - /dev/sdb
# create: true
# lvnames:
# - lvname: test_1
# size: 5g
# create: true
# filesystem: ext4
# mount: true
# mntp: /mnt/test_1
# - lvname: test_2
# size: 10g
# create: true
# filesystem: ext4
# mount: true
# mntp: /mnt/test_2
# - vgname: cinder-volumes
# disks:
# - /dev/cciss/c0d1
# create: true
# lvnames:
# # Set to None to only create LVM VG w/out creating LVM LVOLS
# - None
# Defines if LVM will be managed by role
# default is false to ensure nothing is changed by accident.
manage_lvm: false
```
## Dependencies ## Dependencies
@@ -88,48 +19,16 @@ None
## Example Playbook ## Example Playbook
```yaml [playbook.yml](playbook.yml)
---
- hosts: test-nodes
vars:
lvm_groups:
- vgname: test-vg
disks:
- /dev/sdb
- /dev/sdc
create: true
lvnames:
- lvname: test_1
size: 5g
create: true
filesystem: ext4
mount: true
mntp: /mnt/test_1
- lvname: test_2
size: 10g
create: true
filesystem: ext4
mount: true
mntp: /mnt/test_2
manage_lvm: true
pri_domain_name: 'test.vagrant.local'
roles:
- role: ansible-manage-lvm
tasks:
```
## License ## License
BSD MIT
## Author Information ## Author Information
Larry Smith Jr. Larry Smith Jr.
- [@mrlesmithjr] - [@mrlesmithjr](https://twitter.com/mrlesmithjr)
- <http://everythingshouldbevirtual.com> - [mrlesmithjr@gmail.com](mailto:mrlesmithjr@gmail.com)
- mrlesmithjr [at] gmail.com - [http://everythingshouldbevirtual.com](http://everythingshouldbevirtual.com)
[@mrlesmithjr]: https://www.twitter.com/mrlesmithjr
[ansible]: https://www.ansible.com

View File

@@ -1,7 +1,7 @@
--- ---
galaxy_info: galaxy_info:
author: Larry Smith Jr. author: Larry Smith Jr.
description: Role to manage LVM Groups/Logical Volumes. Can be used to create, extend or resize LVM. description: Ansible role to manage(create, extend, resize) LVM Groups/Logical Volumes.
license: MIT license: MIT
min_ansible_version: 1.2 min_ansible_version: 1.2
@@ -12,17 +12,16 @@ galaxy_info:
- name: EL - name: EL
versions: versions:
- 6 - all
- 7 - name: Fedora
versions:
- all
- name: Ubuntu - name: Ubuntu
versions: versions:
- precise - all
- trusty
- name: Debian - name: Debian
versions: versions:
- jessie - all
- wheezy
galaxy_tags: galaxy_tags:
- system - system
- lvm - lvm

View File

@@ -5,13 +5,27 @@ driver:
name: virtualbox name: virtualbox
lint: yamllint . && flake8 && ansible-lint lint: yamllint . && flake8 && ansible-lint
platforms: platforms:
- name: Fedora-Molecule-LVM - name: CentOS-Molecule-LVM
box: fedora/31-cloud-base box: mrlesmithjr/centos7
cpu: 2
memory: 2048
provider_override_args: provider_override_args:
- "persistent_storage.enabled = true" - "persistent_storage.enabled = true"
- "persistent_storage.location = 'molecule-lvm.vdi'" - "persistent_storage.location = 'centos-molecule-lvm.vdi'"
- "persistent_storage.size = 100"
- "persistent_storage.mount = false"
- "persistent_storage.diskdevice = '/dev/sdb'"
- name: Fedora-Molecule-LVM
box: mrlesmithjr/fedora31
provider_override_args:
- "persistent_storage.enabled = true"
- "persistent_storage.location = 'fedora-molecule-lvm.vdi'"
- "persistent_storage.size = 100"
- "persistent_storage.mount = false"
- "persistent_storage.diskdevice = '/dev/sdb'"
- name: Ubuntu-Molecule-LVM
box: mrlesmithjr/bionic64
provider_override_args:
- "persistent_storage.enabled = true"
- "persistent_storage.location = 'ubuntu-molecule-lvm.vdi'"
- "persistent_storage.size = 100" - "persistent_storage.size = 100"
- "persistent_storage.mount = false" - "persistent_storage.mount = false"
- "persistent_storage.diskdevice = '/dev/sdb'" - "persistent_storage.diskdevice = '/dev/sdb'"

27
playbook.yml Normal file
View File

@@ -0,0 +1,27 @@
---
- hosts: test-nodes
vars:
lvm_groups:
- vgname: test-vg
disks:
- /dev/sdb
- /dev/sdc
create: true
lvnames:
- lvname: test_1
size: 5g
create: true
filesystem: ext4
mount: true
mntp: /mnt/test_1
- lvname: test_2
size: 10g
create: true
filesystem: ext4
mount: true
mntp: /mnt/test_2
manage_lvm: true
tasks:
- name: Include lvm
include_role:
name: ansible-manage-lvm

View File

@@ -1,17 +0,0 @@
#!/usr/bin/env bash
TAR_FILE="v1.6.0.tar.gz"
# Prompt for Ansible role name
read -p "Enter the Ansible role name: " input
# Update .travis.yml with Ansible role name
sed -i '' "s/replace_role/${input}/g" ".travis.yml"
# Update tests/test.yml with Ansible role name
sed -i '' "s/replace_role/${input}/g" "tests/test.yml"
# Cleanup
if [ -f $TAR_FILE ]; then
rm $TAR_FILE
fi

View File

@@ -1,14 +1,14 @@
--- ---
- name: centos | installing lvm2 - name: centos | installing lvm2
package: package:
name: "lvm2" name: lvm2
state: "present" state: present
become: true become: true
- name: centos | installing sg3_utils - name: centos | installing sg3_utils
package: package:
name: "sg3_utils" name: sg3_utils
state: "present" state: present
become: true become: true
- name: centos | debug lvg - name: centos | debug lvg
@@ -36,12 +36,12 @@
- lv.1.create|bool - lv.1.create|bool
- name: centos | checking for scsi devices - name: centos | checking for scsi devices
command: "sg_scan" command: sg_scan
become: true become: true
register: "scsi_devices" register: scsi_devices
changed_when: false changed_when: false
- name: centos | rescanning for new disks - name: centos | rescanning for new disks
command: "/usr/bin/rescan-scsi-bus.sh" command: /usr/bin/rescan-scsi-bus.sh
become: true become: true
changed_when: false changed_when: false

View File

@@ -1,22 +1,22 @@
--- ---
- name: manage_lvm | unmounting filesystem(s) - name: create_fs | unmounting filesystem(s)
mount: mount:
path: "{{ lv.mntp }}" path: "{{ lv.mntp }}"
src: "/dev/{{ vg.vgname }}/{{ lv.lvname }}" src: "/dev/{{ vg.vgname }}/{{ lv.lvname }}"
fstype: "{{ lv.filesystem | default(omit) }}" fstype: "{{ lv.filesystem | default(omit) }}"
state: "absent" state: absent
become: true become: true
loop: "{{ vg.lvnames }}" loop: "{{ vg.lvnames }}"
loop_control: loop_control:
loop_var: lv loop_var: lv
when: > when:
(lv is defined and - lv is defined
lv != 'None') and - lv != 'None'
(lv.create is defined and - lv.create is defined
not lv.create and - not lv.create|bool
lv.filesystem != "swap") - lv.filesystem != "swap"
- name: manage_lvm | creating new filesystem on new LVM logical volume(s) - name: create_fs | creating new filesystem on new LVM logical volume(s)
filesystem: filesystem:
fstype: "{{ lv.filesystem }}" fstype: "{{ lv.filesystem }}"
dev: "/dev/{{ vg.vgname }}/{{ lv.lvname }}" dev: "/dev/{{ vg.vgname }}/{{ lv.lvname }}"
@@ -25,23 +25,19 @@
loop_control: loop_control:
loop_var: lv loop_var: lv
become: true become: true
when: > when:
( - vg.create is defined
(vg.create is defined and - vg.create|bool
vg.create) and - lv is defined
(lv is defined and - lv != 'None'
lv != 'None') and - lv.create is defined
(lv.create is defined and - lv.create|bool
lv.create) and - lv.filesystem is defined
( - lv.filesystem != 'None'
lv.filesystem is defined and - lv.filesystem != 'xfs'
lv.filesystem != 'None' and
lv.filesystem != 'xfs'
)
)
# unable to resize xfs: looks like we've to reference the mountpoint instead of the device
- name: lvm | check already converted # unable to resize xfs: looks like we've to reference the mountpoint instead of the device
- name: create_fs | check already converted
# at least xfs is executed twice if the partition has changed in the meantime # at least xfs is executed twice if the partition has changed in the meantime
# then it tries to recreate the fs on the mounted fs which indeed fails... # then it tries to recreate the fs on the mounted fs which indeed fails...
shell: "xfs_info {{ lv.mntp }} | grep -c 'ftype=1'" shell: "xfs_info {{ lv.mntp }} | grep -c 'ftype=1'"
@@ -51,22 +47,15 @@
loop_var: lv loop_var: lv
register: mountedxfs register: mountedxfs
ignore_errors: true ignore_errors: true
changed_when: no changed_when: false
when: > when:
( - lv is defined and lv != 'None'
(lv is defined and lv != 'None') and - lv.filesystem is defined
( - lv.filesystem == "xfs"
lv.filesystem is defined and - lv.create is defined
lv.filesystem == "xfs" - lv.create|bool
)
and
(
lv.create is defined and
lv.create
)
)
- name: manage_lvm | creating new xfs filesystem on new LVM logical volume(s) - name: create_fs | creating new xfs filesystem on new LVM logical volume(s)
filesystem: filesystem:
fstype: "{{ lv.filesystem }}" fstype: "{{ lv.filesystem }}"
dev: "/dev/{{ vg.vgname }}/{{ lv.lvname }}" dev: "/dev/{{ vg.vgname }}/{{ lv.lvname }}"
@@ -74,37 +63,33 @@
loop_control: loop_control:
loop_var: lv loop_var: lv
become: true become: true
when: > when:
( - mountedxfs is failed
mountedxfs is failed and - vg.create is defined
(vg.create is defined and - vg.create|bool
vg.create) and - lv is defined
(lv is defined and - lv != 'None'
lv != 'None') and - lv.create is defined
(lv.create is defined and - lv.create|bool
lv.create) and - lv.filesystem is defined
( - lv.filesystem == 'xfs'
lv.filesystem is defined and
lv.filesystem == 'xfs'
)
)
- name: manage_lvm | mounting new filesystem(s) - name: create_fs | mounting new filesystem(s)
mount: mount:
path: "{{ lv.mntp }}" path: "{{ lv.mntp }}"
src: "/dev/{{ vg.vgname }}/{{ lv.lvname }}" src: "/dev/{{ vg.vgname }}/{{ lv.lvname }}"
fstype: "{{ lv.filesystem }}" fstype: "{{ lv.filesystem }}"
state: "mounted" state: mounted
opts: "{{ lv.mopts | default('defaults') }}" opts: "{{ lv.mopts | default('defaults') }}"
become: true become: true
loop: "{{ vg.lvnames }}" loop: "{{ vg.lvnames }}"
loop_control: loop_control:
loop_var: lv loop_var: lv
when: > when:
((vg.create is defined and - vg.create is defined
vg.create) and - vg.create|bool
lv != 'None' and - lv != 'None'
(lv.create is defined and - lv.create is defined
lv.create) and - lv.create|bool
(lv.mount is defined and - lv.mount is defined
lv.mount)) - lv.mount|bool

View File

@@ -1,10 +1,10 @@
--- ---
- name: "debug vg" - name: create_lv | Display Volume Group
debug: debug:
var: vg var: vg
verbosity: 2 verbosity: 2
- name: "debug lvm" - name: create_lv | debug lvm
loop: "{{ vg.lvnames }}" loop: "{{ vg.lvnames }}"
debug: debug:
var: lv var: lv
@@ -12,24 +12,22 @@
loop_control: loop_control:
loop_var: lv loop_var: lv
- name: manage_lvm | creating new LVM logical volume(s) - name: create_lv | creating new LVM logical volume(s)
lvol: lvol:
vg: "{{ vg.vgname }}" vg: "{{ vg.vgname }}"
lv: "{{ lv.lvname }}" lv: "{{ lv.lvname }}"
size: "{{ lv.size }}" size: "{{ lv.size }}"
shrink: no shrink: false
opts: "{{ lv.opts | default('') }}" opts: "{{ lv.opts | default('') }}"
state: "present" state: present
loop: "{{ vg.lvnames }}" loop: "{{ vg.lvnames }}"
loop_control: loop_control:
loop_var: lv loop_var: lv
become: true become: true
when: > when:
( - vg.create is defined
(vg.create is defined - vg.create|bool
and vg.create) and - lv is defined
(lv is defined and - lv != 'None'
lv != 'None') and - lv.create is defined
(lv.create is defined and - lv.create|bool
lv.create)
)

View File

@@ -1,12 +1,11 @@
--- ---
- name: create_vg | creating new LVM volume group(s)
- name: manage_lvm | creating new LVM volume group(s)
lvg: lvg:
vg: "{{ item.vgname }}" vg: "{{ item.vgname }}"
pvs: "{{ item.disks | join(',') }}" pvs: "{{ item.disks | join(',') }}"
state: "present" state: present
become: true become: true
loop: "{{ lvm_groups }}" loop: "{{ lvm_groups }}"
when: > when:
item.create is defined and - item.create is defined
item.create - item.create|bool

View File

@@ -1,40 +1,40 @@
--- ---
- name: debian | Updating Apt Cache
apt:
update_cache: true
cache_valid_time: 3600
become: true
- name: debian | installing pre-reqs - name: debian | installing pre-reqs
package: apt:
name: name:
- lvm2 - lvm2
- scsitools - scsitools
state: "present" state: present
become: true become: true
- name: debian | install xfs tools - name: debian | install xfs tools
package: apt:
name: "xfsprogs" name: xfsprogs
state: "present" state: present
become: yes become: true
loop: "{{ lvm_groups|subelements('lvnames') }}" loop: "{{ lvm_groups|subelements('lvnames') }}"
when: > when:
( - item.1 is defined
(item.1 is defined and item.1 != 'None') and - item.1 != 'None'
( - item.1.filesystem is defined
item.1.filesystem is defined and - item.1.filesystem == "xfs"
item.1.filesystem == "xfs" - item.1.create is defined
) - item.1.create|bool
and
(
item.1.create is defined and
item.1.create
)
)
- name: debian | checking for scsi devices - name: debian | checking for scsi devices
command: "sg_scan" command: sg_scan
become: true become: true
register: "scsi_devices" register: scsi_devices
changed_when: false changed_when: false
- name: debian | rescanning for new disks added - name: debian | rescanning for new disks added
command: "/sbin/rescan-scsi-bus" command: /sbin/rescan-scsi-bus
become: true become: true
changed_when: false changed_when: false
when: scsi_devices['stdout'] | length when: scsi_devices['stdout'] | length

View File

@@ -7,6 +7,6 @@
when: ansible_os_family == "RedHat" when: ansible_os_family == "RedHat"
- include_tasks: manage_lvm.yml - include_tasks: manage_lvm.yml
when: > when:
manage_lvm and - lvm_groups is defined
lvm_groups is defined - manage_lvm|bool

View File

@@ -18,23 +18,23 @@
lvol: lvol:
vg: "{{ item.0.vgname }}" vg: "{{ item.0.vgname }}"
lv: "{{ item.1.lvname }}" lv: "{{ item.1.lvname }}"
state: "absent" state: absent
force: yes force: true
become: true become: true
loop: "{{ lvm_groups|subelements('lvnames') }}" loop: "{{ lvm_groups|subelements('lvnames') }}"
when: > when:
(item.1 is defined and - item.1 is defined
item.1 != 'None') and - item.1 != 'None'
(item.1.create is defined and - item.1.create is defined
not item.1.create) - not item.1.create|bool
- name: manage_lvm | Removing LVM volume group(s) - name: manage_lvm | Removing LVM volume group(s)
lvg: lvg:
vg: "{{ item.vgname }}" vg: "{{ item.vgname }}"
pvs: "{{ item.disks | join(',') }}" pvs: "{{ item.disks | join(',') }}"
state: "absent" state: absent
become: true become: true
loop: "{{ lvm_groups }}" loop: "{{ lvm_groups }}"
when: > when:
item.create is defined and - item.create is defined
not item.create - not item.create|bool