mirror of
https://github.com/mrlesmithjr/ansible-manage-lvm.git
synced 2026-02-04 08:49:13 +03:00
Compare commits
117 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3ea52cdda8 | ||
|
|
2d020f26d8 | ||
|
|
3b00335935 | ||
|
|
ac014a161e | ||
|
|
9446ef21d6 | ||
|
|
97300430ad | ||
|
|
73db3c747c | ||
|
|
73b6bce608 | ||
|
|
098bd79154 | ||
|
|
fddf9804dd | ||
|
|
506da4707e | ||
|
|
773ce28061 | ||
|
|
1bb56066fe | ||
|
|
cb792e59a6 | ||
|
|
48e3be3c5c | ||
|
|
2492c96566 | ||
|
|
e4bc8a9e9b | ||
|
|
1d57a469b0 | ||
|
|
19e56ac7d8 | ||
|
|
5c3e601078 | ||
|
|
535b410363 | ||
|
|
f87c42a8c5 | ||
|
|
34e4f08c31 | ||
|
|
f1a54639c6 | ||
|
|
88489df0ac | ||
|
|
b288695b9a | ||
|
|
ed0eb14ce8 | ||
|
|
9c04be9046 | ||
|
|
96fd3b2b06 | ||
|
|
15b2b7b4e0 | ||
|
|
9ead2c9b18 | ||
|
|
79f4787208 | ||
|
|
94582de25d | ||
|
|
6ee72799b4 | ||
|
|
69e25effd4 | ||
|
|
62fc5a5e2b | ||
|
|
c40f9b7d03 | ||
|
|
0621cadde8 | ||
|
|
b7cef8e323 | ||
|
|
59ffcfac4a | ||
|
|
976ff31d00 | ||
|
|
78205e51cb | ||
|
|
b731c20100 | ||
|
|
f2df804926 | ||
|
|
9f37fa3ed1 | ||
|
|
c9a9e1660e | ||
|
|
ec0737d26b | ||
|
|
52c0270a53 | ||
|
|
94be28c09b | ||
|
|
a6b07da847 | ||
|
|
643c7b6ee1 | ||
|
|
b7c3cf9f75 | ||
|
|
e423ebd56b | ||
|
|
9eca9e391b | ||
|
|
881d5d77fa | ||
|
|
89360e3ffe | ||
|
|
5267237c5e | ||
|
|
eda544042a | ||
|
|
c6a7034e4b | ||
|
|
1e997a3e80 | ||
|
|
816d44a6a1 | ||
|
|
883055c33f | ||
|
|
4697b37377 | ||
|
|
325c2d6240 | ||
|
|
7d3e90f9e8 | ||
|
|
db21878de4 | ||
|
|
4a1177e420 | ||
|
|
45315cf2df | ||
|
|
7fd5a8eec9 | ||
|
|
c17a76f9cb | ||
|
|
7e2a076b0a | ||
|
|
4267de6416 | ||
|
|
d3256a3a5a | ||
|
|
f1a9284396 | ||
|
|
dadb9f24f7 | ||
|
|
8666645760 | ||
|
|
2f63eab727 | ||
|
|
6c13d12494 | ||
|
|
050f8a56f1 | ||
|
|
dc1ad5a6f8 | ||
|
|
1a648317c7 | ||
|
|
b955a6f073 | ||
|
|
f81937e9d8 | ||
|
|
c3fea6e456 | ||
|
|
1c3818e5d0 | ||
|
|
12c4dad6e0 | ||
|
|
47f8dae16a | ||
|
|
96fa78d6d0 | ||
|
|
17e8ec1058 | ||
|
|
ba5d929fce | ||
|
|
ea9109220b | ||
|
|
fe860566ba | ||
|
|
d8b3a4e932 | ||
|
|
fc49e1d7b1 | ||
|
|
b15ecea51d | ||
|
|
092546c501 | ||
|
|
9788ee5df6 | ||
|
|
0f428a0e40 | ||
|
|
8957630c04 | ||
|
|
bd866078da | ||
|
|
183087e767 | ||
|
|
25dc548acb | ||
|
|
b3ef85d4f7 | ||
|
|
9f4afa7afb | ||
|
|
5603c5f6b0 | ||
|
|
118ec79cb0 | ||
|
|
563aa1effb | ||
|
|
4a58cb36cf | ||
|
|
a0c784797f | ||
|
|
51b79c5e71 | ||
|
|
66368de1d3 | ||
|
|
075acb3484 | ||
|
|
386cc28bdb | ||
|
|
26ed7d826c | ||
|
|
0d255cb5ce | ||
|
|
9844b5fd47 | ||
|
|
f2d06d0d46 |
1
.ansible-lint
Normal file
1
.ansible-lint
Normal file
@@ -0,0 +1 @@
|
||||
skip_list: []
|
||||
14
.github/config.yml
vendored
Normal file
14
.github/config.yml
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
# Configuration for request-info - https://github.com/behaviorbot/request-info
|
||||
|
||||
# *Required* Comment to reply with
|
||||
requestInfoReplyComment: >
|
||||
We would appreciate it if you could provide us with more info about this issue/pr!
|
||||
|
||||
# *OPTIONAL* default titles to check against for lack of descriptiveness
|
||||
# MUST BE ALL LOWERCASE
|
||||
requestInfoDefaultTitles:
|
||||
- update readme.md
|
||||
- updates
|
||||
|
||||
# *OPTIONAL* Label to be added to Issues and Pull Requests with insufficient information given
|
||||
requestInfoLabelToAdd: needs-more-info
|
||||
32
.github/release-drafter.yml
vendored
Normal file
32
.github/release-drafter.yml
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
name-template: "v$RESOLVED_VERSION 🌈"
|
||||
tag-template: "v$RESOLVED_VERSION"
|
||||
categories:
|
||||
- title: "🚀 Features"
|
||||
labels:
|
||||
- "feature"
|
||||
- "enhancement"
|
||||
- title: "🐛 Bug Fixes"
|
||||
labels:
|
||||
- "fix"
|
||||
- "bugfix"
|
||||
- "bug"
|
||||
- title: "🧰 Maintenance"
|
||||
label: "chore"
|
||||
- title: "🧺 Miscellaneous" #Everything except ABAP
|
||||
label: "misc"
|
||||
change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
|
||||
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
|
||||
version-resolver:
|
||||
major:
|
||||
labels:
|
||||
- "major"
|
||||
minor:
|
||||
labels:
|
||||
- "minor"
|
||||
patch:
|
||||
labels:
|
||||
- "patch"
|
||||
default: patch
|
||||
template: |
|
||||
## Changes
|
||||
$CHANGES
|
||||
10
.github/settings.yml
vendored
Normal file
10
.github/settings.yml
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
# These settings are synced to GitHub by https://probot.github.io/apps/settings/
|
||||
|
||||
repository:
|
||||
# See https://developer.github.com/v3/repos/#edit for all available settings.
|
||||
|
||||
# The name of the repository. Changing this will rename the repository
|
||||
name: ansible-manage-lvm
|
||||
|
||||
# A short description of the repository that will show up on GitHub
|
||||
description: Ansible role to manage LVM Groups/Logical Volumes
|
||||
17
.github/stale.yml
vendored
Normal file
17
.github/stale.yml
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
# Number of days of inactivity before an issue becomes stale
|
||||
daysUntilStale: 60
|
||||
# Number of days of inactivity before a stale issue is closed
|
||||
daysUntilClose: 7
|
||||
# Issues with these labels will never be considered stale
|
||||
exemptLabels:
|
||||
- pinned
|
||||
- security
|
||||
# Label to use when marking an issue as stale
|
||||
staleLabel: wontfix
|
||||
# Comment to post when marking an issue as stale. Set to `false` to disable
|
||||
markComment: >
|
||||
This issue has been automatically marked as stale because it has not had
|
||||
recent activity. It will be closed if no further activity occurs. Thank you
|
||||
for your contributions.
|
||||
# Comment to post when closing a stale issue. Set to `false` to disable
|
||||
closeComment: false
|
||||
46
.github/workflows/molecule.yml
vendored
Normal file
46
.github/workflows/molecule.yml
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
---
|
||||
name: Molecule
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- main
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- develop
|
||||
- main
|
||||
- master
|
||||
|
||||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||
jobs:
|
||||
lint:
|
||||
# The type of runner that the job will run on
|
||||
runs-on: macos-10.15
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: [3.8]
|
||||
|
||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r requirements.txt -r requirements-dev.txt
|
||||
- name: molecule lint
|
||||
run: |
|
||||
molecule lint
|
||||
17
.github/workflows/release-drafter.yml
vendored
Normal file
17
.github/workflows/release-drafter.yml
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
name: Release Drafter
|
||||
|
||||
on:
|
||||
push:
|
||||
# branches to consider in the event; optional, defaults to all
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
|
||||
jobs:
|
||||
update_release_draft:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# Drafts your next Release notes as Pull Requests are merged into "master"
|
||||
- uses: release-drafter/release-drafter@v5
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
34
.github/workflows/release-galaxy.yml
vendored
Normal file
34
.github/workflows/release-galaxy.yml
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
name: Ansible Galaxy
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
release:
|
||||
types:
|
||||
- published
|
||||
|
||||
jobs:
|
||||
galaxy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r requirements.txt -r requirements-dev.txt
|
||||
- name: Trigger a new import on Galaxy.
|
||||
run: ansible-galaxy role import --api-key ${{ secrets.GALAXY_API_KEY }} $(echo ${{ github.repository }} | cut -d/ -f1) $(echo ${{ github.repository }} | cut -d/ -f2)
|
||||
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
.idea
|
||||
**/__pycache__
|
||||
.venv/
|
||||
32
.travis.yml
Normal file
32
.travis.yml
Normal file
@@ -0,0 +1,32 @@
|
||||
---
|
||||
dist: bionic
|
||||
|
||||
language: python
|
||||
python:
|
||||
- "3.8"
|
||||
|
||||
before_install:
|
||||
- |
|
||||
sudo apt -y install bridge-utils dnsmasq-base ebtables libvirt-bin libvirt-dev qemu-kvm qemu-utils ruby-dev
|
||||
|
||||
- |
|
||||
wget https://releases.hashicorp.com/vagrant/2.2.7/vagrant_2.2.7_x86_64.deb
|
||||
sudo apt -y install ./vagrant_2.2.7_x86_64.deb
|
||||
sudo vagrant plugin install vagrant-libvirt
|
||||
|
||||
- |
|
||||
sudo apt-get -y purge python3-openssl && sudo apt-get -y autoremove
|
||||
sudo apt-get update && sudo apt-get install -y ca-certificates curl gcc iproute2 python3 python3-dev sudo
|
||||
curl -skL https://bootstrap.pypa.io/get-pip.py | sudo -H python3
|
||||
sudo pip3 install wheel
|
||||
sudo pip3 install netaddr python-vagrant yamllint testinfra flake8
|
||||
sudo pip3 install ansible ansible-lint
|
||||
sudo pip3 install -I molecule molecule-vagrant
|
||||
|
||||
script:
|
||||
- |
|
||||
sudo molecule test --scenario-name kvm
|
||||
sudo molecule test --scenario-name kvmsinglelv
|
||||
sudo molecule test --scenario-name kvmonlyvg
|
||||
notifications:
|
||||
webhooks: https://galaxy.ansible.com/api/v1/notifications/
|
||||
36
.yamllint.yml
Normal file
36
.yamllint.yml
Normal file
@@ -0,0 +1,36 @@
|
||||
---
|
||||
# Based on ansible-lint config
|
||||
extends: default
|
||||
|
||||
ignore: |
|
||||
.venv/
|
||||
|
||||
rules:
|
||||
braces:
|
||||
max-spaces-inside: 1
|
||||
level: error
|
||||
brackets:
|
||||
max-spaces-inside: 1
|
||||
level: error
|
||||
colons:
|
||||
max-spaces-after: -1
|
||||
level: error
|
||||
commas:
|
||||
max-spaces-after: -1
|
||||
level: error
|
||||
comments: disable
|
||||
comments-indentation: disable
|
||||
document-start: disable
|
||||
empty-lines:
|
||||
max: 3
|
||||
level: error
|
||||
hyphens:
|
||||
level: error
|
||||
indentation: disable
|
||||
key-duplicates: enable
|
||||
line-length: disable
|
||||
new-line-at-end-of-file: disable
|
||||
new-lines:
|
||||
type: unix
|
||||
trailing-spaces: disable
|
||||
truthy: disable
|
||||
323
CHANGELOG.md
323
CHANGELOG.md
@@ -1,19 +1,322 @@
|
||||
# Change Log
|
||||
commit 881d5d77fa435ccaa026c3341d0d2ac1fb537b98
|
||||
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
|
||||
Date: Mon Apr 27 11:26:18 2020 -0400
|
||||
|
||||
## [Unreleased](https://github.com/mrlesmithjr/ansible-manage-lvm/tree/HEAD)
|
||||
Fixing syntax issue for wantlist
|
||||
|
||||
[Full Changelog](https://github.com/mrlesmithjr/ansible-manage-lvm/compare/v0.1.0...HEAD)
|
||||
commit 89360e3ffef9ff1dbbb5ad525a7ee1d77e6b8895
|
||||
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
|
||||
Date: Mon Apr 27 11:16:02 2020 -0400
|
||||
|
||||
**Closed issues:**
|
||||
Trying to fix the subelements lookup for a single element
|
||||
|
||||
- Role fails on CentOS due to system-storage-manager package [\#2](https://github.com/mrlesmithjr/ansible-manage-lvm/issues/2)
|
||||
This addresses #42. Will need to do some validation testing, etc.
|
||||
|
||||
## [v0.1.0](https://github.com/mrlesmithjr/ansible-manage-lvm/tree/v0.1.0) (2016-09-30)
|
||||
**Merged pull requests:**
|
||||
commit c6a7034e4b0b381c5c5b44a15ce7baad7eab9c1b
|
||||
Author: Charlie Mordant <cmordant1@gmail.com>
|
||||
Date: Fri Apr 24 17:22:07 2020 +0200
|
||||
|
||||
- Replace system-storage-manager with lvm2 in centos [\#3](https://github.com/mrlesmithjr/ansible-manage-lvm/pull/3) ([rohitkothari](https://github.com/rohitkothari))
|
||||
- Add xfs\_growfs for xfs systemfile type. [\#1](https://github.com/mrlesmithjr/ansible-manage-lvm/pull/1) ([olo-dw](https://github.com/olo-dw))
|
||||
remove unused molecule env property
|
||||
|
||||
commit 883055c33f2d6b4c0df8e61ce49771c451905334
|
||||
Author: Charlie Mordant <cmordant1@gmail.com>
|
||||
Date: Thu Apr 23 19:38:35 2020 +0200
|
||||
|
||||
lint
|
||||
|
||||
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
|
||||
commit 325c2d6240022fe17abf40dffee842ccf79543f1
|
||||
Author: Charlie Mordant <cmordant1@gmail.com>
|
||||
Date: Thu Apr 23 19:25:09 2020 +0200
|
||||
|
||||
install xfs
|
||||
|
||||
commit 4a1177e420fd9632f77d07ce0a19f89a1515f8eb
|
||||
Author: Charlie Mordant <cmordant1@gmail.com>
|
||||
Date: Tue Apr 21 19:01:29 2020 +0200
|
||||
|
||||
use xfs_info on mountpoint instead of lvm
|
||||
|
||||
commit 7fd5a8eec9f4b5110929862056ab88c4db3f14de
|
||||
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
|
||||
Date: Sun Apr 19 01:59:29 2020 -0400
|
||||
|
||||
Only doing a Molecule lint at this time
|
||||
|
||||
commit 7e2a076b0a8155015fd21502db860fa89a2114b3
|
||||
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
|
||||
Date: Sun Apr 19 01:44:38 2020 -0400
|
||||
|
||||
Added Python requirements for testing, etc.
|
||||
|
||||
Closes #33
|
||||
|
||||
commit dadb9f24f7ebc2752e6495c4c3569bdee5e0cc68
|
||||
Author: Charlie Mordant <cmordant1@gmail.com>
|
||||
Date: Fri Apr 17 13:12:06 2020 +0200
|
||||
|
||||
remove unwanted files
|
||||
|
||||
commit 2f63eab727cf7b0b389d0d0cc1a1c7236b71f839
|
||||
Author: Charlie Mordant <cmordant1@gmail.com>
|
||||
Date: Fri Apr 17 12:56:31 2020 +0200
|
||||
|
||||
code smells
|
||||
|
||||
commit 050f8a56f10d81f7827be53b8c769b1aa5021c00
|
||||
Author: Charlie Mordant <cmordant1@gmail.com>
|
||||
Date: Wed Apr 15 19:08:34 2020 +0200
|
||||
|
||||
typo in check
|
||||
|
||||
commit b955a6f073b91773f5f90da878268e74872a99e9
|
||||
Author: Charlie Mordant <cmordant1@gmail.com>
|
||||
Date: Wed Apr 15 18:54:17 2020 +0200
|
||||
|
||||
remove unwanted newline
|
||||
|
||||
commit f81937e9d82bc48f2ee03f6ff462c32bca3da8f0
|
||||
Author: Charlie Mordant <cmordant1@gmail.com>
|
||||
Date: Wed Apr 15 18:52:52 2020 +0200
|
||||
|
||||
makes xfs mountpoint repeatable
|
||||
|
||||
commit 1c3818e5d06887c01dc0a4b88a39c0561a446300
|
||||
Author: Charlie Mordant <cmordant1@gmail.com>
|
||||
Date: Wed Apr 15 17:34:53 2020 +0200
|
||||
|
||||
mistake on remove volume
|
||||
|
||||
commit 47f8dae16a096050dccbb8d161f4a18946a6ae73
|
||||
Author: Charlie Mordant <cmordant1@gmail.com>
|
||||
Date: Wed Apr 15 17:13:38 2020 +0200
|
||||
|
||||
github action lint
|
||||
|
||||
commit 96fa78d6d099d0a48642d377d3e7f30a0c554bdf
|
||||
Author: Charlie Mordant <cmordant1@gmail.com>
|
||||
Date: Wed Apr 15 17:07:33 2020 +0200
|
||||
|
||||
remove deprecated machines
|
||||
|
||||
commit 17e8ec1058c5cb66b21b15a8d3912ac9980508a9
|
||||
Author: Charlie Mordant <cmordant1@gmail.com>
|
||||
Date: Wed Apr 15 16:56:18 2020 +0200
|
||||
|
||||
configured molecule and fix xfs on centos
|
||||
|
||||
commit ba5d929fce982af9baa44cfe8ad0b3079133f444
|
||||
Author: Charlie Mordant <cmordant1@gmail.com>
|
||||
Date: Wed Apr 15 15:14:30 2020 +0200
|
||||
|
||||
use dots instead of carets
|
||||
|
||||
commit ea9109220bb268b5f14e75e38d9fb32c2d79bae5
|
||||
Author: Charlie Mordant <cmordant1@gmail.com>
|
||||
Date: Wed Apr 15 14:33:41 2020 +0200
|
||||
|
||||
molecule test and idempotence
|
||||
|
||||
commit d8b3a4e93257dfeb79bc8d4ef349acb53f0019dc
|
||||
Author: Samuel Mutel <smu-dw@deveryware.net>
|
||||
Date: Mon Oct 14 12:21:03 2019 +0200
|
||||
|
||||
bug: Resize XFS parts is not working
|
||||
|
||||
commit b15ecea51d0045a89aae24e4b0c108b35f060b2c
|
||||
Author: Tony Peña <emperor.cu@gmail.com>
|
||||
Date: Wed Jun 26 14:56:13 2019 +0200
|
||||
|
||||
Update debian.yml
|
||||
|
||||
Since ansible 2.8.0 must be change way using dict
|
||||
|
||||
commit 9788ee5df68798ad94f11c8133b1d62ff409d0e8
|
||||
Author: Michele Caputo <mikap83@gmail.com>
|
||||
Date: Mon Apr 8 14:16:04 2019 +0200
|
||||
|
||||
issue #23: extra parenthesis
|
||||
|
||||
commit 0f428a0e40d71aea410fbc1aa329203c0b4f15cd
|
||||
Author: faisalnizam <faisal@logiik.com>
|
||||
Date: Tue Mar 26 10:48:45 2019 +0400
|
||||
|
||||
FIX LINT FOR BUILD
|
||||
|
||||
FIX LINT FOR BUILD
|
||||
|
||||
commit 8957630c04b8befa99c08ed667e43d95198202ce
|
||||
Author: faisalnizam <faisal@logiik.com>
|
||||
Date: Tue Mar 26 10:40:11 2019 +0400
|
||||
|
||||
Adding SWAP FileSystem Exception
|
||||
|
||||
Adding Check for SWAP Filesystem if defined skip
|
||||
1. SKIP New Filesystem Creation
|
||||
2. SKIP mountpoint check
|
||||
|
||||
commit 183087e767cbce08ce2da1a3b04f47d3fc03a7e6
|
||||
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
|
||||
Date: Tue Apr 2 08:03:42 2019 -0400
|
||||
|
||||
Resolves #21
|
||||
|
||||
commit b3ef85d4f738597260d9db0d90e84d0f8721259a
|
||||
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
|
||||
Date: Wed Dec 5 08:39:10 2018 -0500
|
||||
|
||||
Added skip codes for ansible-lint
|
||||
|
||||
commit 9f4afa7afb3fedc270c44ff1fa357da4b87845c0
|
||||
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
|
||||
Date: Wed Dec 5 08:00:13 2018 -0500
|
||||
|
||||
Fixing Travis testing and yamllint issues
|
||||
|
||||
commit 5603c5f6b0899a1b2cdeeeb3c035eb6249e96fa7
|
||||
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
|
||||
Date: Wed Dec 5 07:51:31 2018 -0500
|
||||
|
||||
Added Travis testing and hooks for galaxy
|
||||
|
||||
commit 563aa1effba936340cbaad9766a49f570292edee
|
||||
Author: Mark Goddard <mark@stackhpc.com>
|
||||
Date: Wed Oct 31 11:42:20 2018 +0000
|
||||
|
||||
Fix indentation
|
||||
|
||||
commit 4a58cb36cf6d4dd4bb23e86972658be508cca082
|
||||
Author: Mark Goddard <mark@stackhpc.com>
|
||||
Date: Wed Oct 31 11:16:27 2018 +0000
|
||||
|
||||
Update tasks/manage_lvm.yml
|
||||
|
||||
Co-Authored-By: oneswig <stig.github@telfer.org>
|
||||
|
||||
commit a0c784797f538fc5393d75589ac48e86c51e88db
|
||||
Author: Stig Telfer <stig@stackhpc.com>
|
||||
Date: Wed Oct 31 10:16:44 2018 +0100
|
||||
|
||||
Support not formatting volumes.
|
||||
|
||||
Logic to make the filesystem attribute optional, in situations where
|
||||
we do not want the volumes formatted.
|
||||
|
||||
commit 66368de1d3d2b6712cbf66fc3dd0962705bf86f9
|
||||
Author: David Castellanos <dcastellanos@fintonic.com>
|
||||
Date: Mon Dec 18 00:33:45 2017 +0100
|
||||
|
||||
Add opts and mopts support
|
||||
|
||||
commit 386cc28bdb58886ed492d3438c9cb088d36de161
|
||||
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
|
||||
Date: Sun Jun 11 14:57:53 2017 -0400
|
||||
|
||||
Addresses issue #10
|
||||
|
||||
Signed-off-by: Larry Smith Jr <mrlesmithjr@gmail.com>
|
||||
|
||||
commit 0d255cb5ce9e6016a503203c2ed39a70fb0ccd9c
|
||||
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
|
||||
Date: Fri May 5 09:12:25 2017 -0400
|
||||
|
||||
Fixes issue #8
|
||||
|
||||
Signed-off-by: Larry Smith Jr <mrlesmithjr@gmail.com>
|
||||
|
||||
commit f2d06d0d46086da0191b4dbde0d420e709e3ea01
|
||||
Author: Stefan Heimberg <kontakt@stefanheimberg.ch>
|
||||
Date: Thu Apr 6 00:25:55 2017 +0200
|
||||
|
||||
added support for btrfs
|
||||
|
||||
commit 7749d0c62a6e1539aff94c57fd2c0eeaf43dd1a0
|
||||
Author: Kevin Loveland <kevin.loveland@gmail.com>
|
||||
Date: Fri Nov 18 10:26:16 2016 -0800
|
||||
|
||||
Fixed issue with idempotency of lvol module. See ansible-module-extras issue #428
|
||||
|
||||
commit 3ad965237280d534f0aab0027f9ef61701354e8b
|
||||
Author: Kevin Loveland <kevin.loveland@gmail.com>
|
||||
Date: Thu Nov 17 15:17:26 2016 -0800
|
||||
|
||||
Changes to adjust to removal of bare vars in Ansible 2.2
|
||||
|
||||
commit a82877c290cfe0b62eda90d8874b8e2b62402946
|
||||
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
|
||||
Date: Sun Oct 2 09:58:47 2016 -0400
|
||||
|
||||
First commit of CHANGELOG
|
||||
|
||||
Signed-off-by: Larry Smith Jr <mrlesmithjr@gmail.com>
|
||||
|
||||
commit 99366fa547faccb0359dd8d3b19cec802640eb95
|
||||
Author: Rohit Kothari <rohietkothari@gmail.com>
|
||||
Date: Thu Sep 29 17:59:19 2016 -0700
|
||||
|
||||
Replace system-storage-manager with lvm2 in centos
|
||||
|
||||
commit ca1535d774b4e3310fc993841f1f99400612c7a5
|
||||
Author: Olivier LOCARD <olivier.locard@deveryware.com>
|
||||
Date: Fri Sep 23 16:21:07 2016 +0200
|
||||
|
||||
Add xfs_growfs for xfs systemfile type.
|
||||
|
||||
commit bb87fa8dbff5df50ed376db74a6d2b95f64fd745
|
||||
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
|
||||
Date: Tue Nov 3 10:39:58 2015 -0500
|
||||
|
||||
updated vars and conditionals
|
||||
|
||||
commit 49b20e2e4a80581f1c53559ff4073b3384eae28c
|
||||
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
|
||||
Date: Tue Nov 3 10:24:54 2015 -0500
|
||||
|
||||
updated when conditions
|
||||
|
||||
commit 0232734bed92e976376d4c9f2550b515f72f3d54
|
||||
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
|
||||
Date: Tue Nov 3 10:22:09 2015 -0500
|
||||
|
||||
updated tasks to only work when lvnames is defined
|
||||
|
||||
commit 9f592112095208843da1fd69a658bd49c163a7bb
|
||||
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
|
||||
Date: Tue Nov 3 09:37:38 2015 -0500
|
||||
|
||||
updated vars and meta
|
||||
|
||||
commit 686455514d8bc0da70b3440dbc5afe669188d333
|
||||
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
|
||||
Date: Tue Nov 3 09:22:00 2015 -0500
|
||||
|
||||
cleaned up and fixed all tasks including swap
|
||||
|
||||
commit 9f5c61e25599a130e1625e879438561cc1f6a437
|
||||
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
|
||||
Date: Mon Nov 2 23:38:38 2015 -0500
|
||||
|
||||
added new task
|
||||
|
||||
commit a5103ff6396138f531cf8457f16706b6fc90d1d1
|
||||
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
|
||||
Date: Mon Nov 2 23:38:23 2015 -0500
|
||||
|
||||
changing role tasks and vars
|
||||
|
||||
commit c776e9f339f0bcfe987aa571d29411ac44a29526
|
||||
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
|
||||
Date: Mon Nov 2 21:50:07 2015 -0500
|
||||
|
||||
updated meta
|
||||
|
||||
commit 46e0fd1fc2477693fc66aa4b38ac7bde19087047
|
||||
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
|
||||
Date: Mon Nov 2 21:23:59 2015 -0500
|
||||
|
||||
updated meta
|
||||
|
||||
commit d1d99b2f17d3bc46a479af5d01a976686429b7ce
|
||||
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
|
||||
Date: Mon Nov 2 21:23:03 2015 -0500
|
||||
|
||||
first commit
|
||||
|
||||
93
README.md
93
README.md
@@ -1,89 +1,34 @@
|
||||
Role Name
|
||||
=========
|
||||
# ansible-manage-lvm
|
||||
|
||||
Role to manage LVM Groups/Logical Volumes. Can be used to create, extend or resize LVM Groups and volumes.
|
||||
Ansible role to manage LVM Groups/Logical Volumes.
|
||||
|
||||
Requirements
|
||||
------------
|
||||
> NOTE: Can be used to create, extend or resize LVM Groups and volumes.
|
||||
|
||||
Devices/disks to be part of the LVM setup must be identified prior to using this role. Ensure that you select the correct devices/disks.
|
||||
##### To only create an LVM VG w/out creating LVM LVOLS...define lvname w/ var as None as in the below example.
|
||||
## Requirements
|
||||
|
||||
Role Variables
|
||||
--------------
|
||||
Devices/disks to be members of the LVM setup **must be** identified prior to
|
||||
using this role.
|
||||
|
||||
````
|
||||
---
|
||||
# defaults file for ansible-manage-lvm
|
||||
lvm_groups:
|
||||
- vgname: ubuntu-vg
|
||||
disks: /dev/sda5,/dev/sdc,/dev/sdd #for multiple disks...../dev/sdb,/dev/sdc
|
||||
create: true #defines if VG should exist or be removed....true or false
|
||||
lvnames:
|
||||
- lvname: swap_1
|
||||
size: 5g #define size of lvol...100%FREE, 10g, 1024 (megabytes by default)
|
||||
create: true #defines if lvol should exist or be removed...true or false
|
||||
filesystem: swap #defines filesystem to format lvol as
|
||||
mount: false #defines if filesystem should be mounted
|
||||
mntp: [] #defines mountpoint for lvol
|
||||
- lvname: root
|
||||
size: 40g #define size of lvol...100%FREE, 10g, 1024 (megabytes by default)
|
||||
create: true #defines if lvol should exist or be removed...true or false
|
||||
filesystem: ext4 #defines filesystem to format lvol as
|
||||
mount: true
|
||||
mntp: / #defines mountpoint for lvol
|
||||
- vgname: test-vg
|
||||
disks: /dev/sdb #for multiple disks...../dev/sdb,/dev/sdc
|
||||
create: true #defines if VG should exist or be removed....true or false
|
||||
lvnames:
|
||||
- lvname: test_1
|
||||
size: 5g #define size of lvol...100%FREE, 10g, 1024 (megabytes by default)
|
||||
create: true #defines if lvol should exist or be removed...true or false
|
||||
filesystem: ext4 #defines filesystem to format lvol as
|
||||
mount: true #defines if filesystem should be mounted
|
||||
mntp: /mnt/test_1 #defines mountpoint for lvol
|
||||
- lvname: test_2
|
||||
size: 10g #define size of lvol...100%FREE, 10g, 1024 (megabytes by default)
|
||||
create: true #defines if lvol should exist or be removed...true or false
|
||||
filesystem: ext4 #defines filesystem to format lvol as
|
||||
mount: true
|
||||
mntp: /mnt/test_2 #defines mountpoint for lvol
|
||||
# - vgname: cinder-volumes
|
||||
# disks: /dev/cciss/c0d1 #for multiple disks...../dev/sdb,/dev/sdc
|
||||
# create: true #defines if VG should exist or be removed....true or false
|
||||
# lvnames:
|
||||
# - None #set to None to only create LVM VG w/out creating LVM LVOLS...
|
||||
manage_lvm: false #defines if LVM will be managed by role....default is false to ensure nothing is changed by accident.
|
||||
````
|
||||
## Role Variables
|
||||
|
||||
Dependencies
|
||||
------------
|
||||
[defaults/main.yml](defaults/main.yml)
|
||||
|
||||
## Dependencies
|
||||
|
||||
None
|
||||
|
||||
Example Playbook
|
||||
----------------
|
||||
## Example Playbook
|
||||
|
||||
#### Galaxy
|
||||
-----------
|
||||
- hosts: servers
|
||||
roles:
|
||||
- mrlesmithjr.manage-lvm
|
||||
#### GitHub
|
||||
-----------
|
||||
- hosts: servers
|
||||
roles:
|
||||
- ansible-manage-lvm
|
||||
[playbook.yml](playbook.yml)
|
||||
|
||||
License
|
||||
-------
|
||||
## License
|
||||
|
||||
BSD
|
||||
MIT
|
||||
|
||||
Author Information
|
||||
------------------
|
||||
## Author Information
|
||||
|
||||
Larry Smith Jr.
|
||||
- @mrlesmithjr
|
||||
- http://everythingshouldbevirtual.com
|
||||
- mrlesmithjr [at] gmail.com
|
||||
|
||||
- [@mrlesmithjr](https://twitter.com/mrlesmithjr)
|
||||
- [mrlesmithjr@gmail.com](mailto:mrlesmithjr@gmail.com)
|
||||
- [http://everythingshouldbevirtual.com](http://everythingshouldbevirtual.com)
|
||||
|
||||
@@ -1,41 +1,77 @@
|
||||
---
|
||||
# defaults file for ansible-manage-lvm
|
||||
lvm_groups:
|
||||
- vgname: ubuntu-vg
|
||||
disks: /dev/sda5,/dev/sdc,/dev/sdd #for multiple disks...../dev/sdb,/dev/sdc
|
||||
create: true #defines if VG should exist or be removed....true or false
|
||||
lvnames:
|
||||
- lvname: swap_1
|
||||
size: 5g #define size of lvol...100%FREE, 10g, 1024 (megabytes by default)
|
||||
create: true #defines if lvol should exist or be removed...true or false
|
||||
filesystem: swap #defines filesystem to format lvol as
|
||||
mount: false #defines if filesystem should be mounted
|
||||
mntp: [] #defines mountpoint for lvol
|
||||
- lvname: root
|
||||
size: 40g #define size of lvol...100%FREE, 10g, 1024 (megabytes by default)
|
||||
create: true #defines if lvol should exist or be removed...true or false
|
||||
filesystem: ext4 #defines filesystem to format lvol as
|
||||
mount: true
|
||||
mntp: / #defines mountpoint for lvol
|
||||
- vgname: test-vg
|
||||
disks: /dev/sdb #for multiple disks...../dev/sdb,/dev/sdc
|
||||
create: true #defines if VG should exist or be removed....true or false
|
||||
lvnames:
|
||||
- lvname: test_1
|
||||
size: 5g #define size of lvol...100%FREE, 10g, 1024 (megabytes by default)
|
||||
create: true #defines if lvol should exist or be removed...true or false
|
||||
filesystem: ext4 #defines filesystem to format lvol as
|
||||
mount: true #defines if filesystem should be mounted
|
||||
mntp: /mnt/test_1 #defines mountpoint for lvol
|
||||
- lvname: test_2
|
||||
size: 10g #define size of lvol...100%FREE, 10g, 1024 (megabytes by default)
|
||||
create: true #defines if lvol should exist or be removed...true or false
|
||||
filesystem: ext4 #defines filesystem to format lvol as
|
||||
mount: true
|
||||
mntp: /mnt/test_2 #defines mountpoint for lvol
|
||||
# - vgname: cinder-volumes
|
||||
# disks: /dev/cciss/c0d1 #for multiple disks...../dev/sdb,/dev/sdc
|
||||
# create: true #defines if VG should exist or be removed....true or false
|
||||
# lvnames:
|
||||
# - None #set to None to only create LVM VG w/out creating LVM LVOLS...
|
||||
manage_lvm: false #defines if LVM will be managed by role....default is false to ensure nothing is changed by accident.
|
||||
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
|
||||
|
||||
### nvme to scsi device name map binary helper
|
||||
ebsnvme_binary_helper_ver: '0.1.3'
|
||||
ebsnvme_binary_helper_tmp: '/tmp'
|
||||
ebsnvme_binary_helper_path: '/sbin/go-ebsnvme'
|
||||
|
||||
### nvme to scsi device name map script helper
|
||||
ebsnvme_scrip_helper_path: '/usr/local/bin/ebsnvme-id'
|
||||
|
||||
### auto pvresize (waiting until ansible 2.10 or above as collections have new lvg with integrated pvresize)
|
||||
### waiting for new module in collection set to true or run pvresize manually on remote systems
|
||||
### https://docs.ansible.com/ansible/3/collections/community/general/lvg_module.html
|
||||
###
|
||||
pvresize_to_max: false
|
||||
|
||||
156
meta/main.yml
156
meta/main.yml
@@ -1,138 +1,30 @@
|
||||
---
|
||||
galaxy_info:
|
||||
author: Larry Smith Jr.
|
||||
description: Role to manage LVM Groups/Logical Volumes. Can be used to create, extend or resize LVM.
|
||||
#company: your company (optional)
|
||||
# If the issue tracker for your role is not on github, uncomment the
|
||||
# next line and provide a value
|
||||
# issue_tracker_url: http://example.com/issue/tracker
|
||||
# Some suggested licenses:
|
||||
# - BSD (default)
|
||||
# - MIT
|
||||
# - GPLv2
|
||||
# - GPLv3
|
||||
# - Apache
|
||||
# - CC-BY
|
||||
license: license (GPLv2, CC-BY, etc)
|
||||
description: Ansible role to manage(create, extend, resize) LVM Groups/Logical Volumes.
|
||||
namespace: mrlesmithjr
|
||||
role_name: manage-lvm
|
||||
|
||||
license: MIT
|
||||
min_ansible_version: 1.2
|
||||
#
|
||||
# Below are all platforms currently available. Just uncomment
|
||||
# the ones that apply to your role. If you don't see your
|
||||
# platform on this list, let us know and we'll get it added!
|
||||
#
|
||||
platforms:
|
||||
- name: EL
|
||||
versions:
|
||||
# - all
|
||||
# - 5
|
||||
- 6
|
||||
- 7
|
||||
#- name: GenericUNIX
|
||||
# versions:
|
||||
# - all
|
||||
# - any
|
||||
#- name: Fedora
|
||||
# versions:
|
||||
# - all
|
||||
# - 16
|
||||
# - 17
|
||||
# - 18
|
||||
# - 19
|
||||
# - 20
|
||||
# - 21
|
||||
# - 22
|
||||
#- name: Windows
|
||||
# versions:
|
||||
# - all
|
||||
# - 2012R2
|
||||
#- name: SmartOS
|
||||
# versions:
|
||||
# - all
|
||||
# - any
|
||||
#- name: opensuse
|
||||
# versions:
|
||||
# - all
|
||||
# - 12.1
|
||||
# - 12.2
|
||||
# - 12.3
|
||||
# - 13.1
|
||||
# - 13.2
|
||||
#- name: Amazon
|
||||
# versions:
|
||||
# - all
|
||||
# - 2013.03
|
||||
# - 2013.09
|
||||
#- name: GenericBSD
|
||||
# versions:
|
||||
# - all
|
||||
# - any
|
||||
#- name: FreeBSD
|
||||
# versions:
|
||||
# - all
|
||||
# - 8.0
|
||||
# - 8.1
|
||||
# - 8.2
|
||||
# - 8.3
|
||||
# - 8.4
|
||||
# - 9.0
|
||||
# - 9.1
|
||||
# - 9.1
|
||||
# - 9.2
|
||||
- name: Ubuntu
|
||||
versions:
|
||||
# - all
|
||||
# - lucid
|
||||
# - maverick
|
||||
# - natty
|
||||
# - oneiric
|
||||
- precise
|
||||
# - quantal
|
||||
# - raring
|
||||
# - saucy
|
||||
- trusty
|
||||
# - utopic
|
||||
# - vivid
|
||||
#- name: SLES
|
||||
# versions:
|
||||
# - all
|
||||
# - 10SP3
|
||||
# - 10SP4
|
||||
# - 11
|
||||
# - 11SP1
|
||||
# - 11SP2
|
||||
# - 11SP3
|
||||
#- name: GenericLinux
|
||||
# versions:
|
||||
# - all
|
||||
# - any
|
||||
#- name: Debian
|
||||
# versions:
|
||||
# - all
|
||||
# - etch
|
||||
# - jessie
|
||||
# - lenny
|
||||
# - squeeze
|
||||
# - wheezy
|
||||
#
|
||||
# Below are all categories currently available. Just as with
|
||||
# the platforms above, uncomment those that apply to your role.
|
||||
#
|
||||
categories:
|
||||
#- cloud
|
||||
#- cloud:ec2
|
||||
#- cloud:gce
|
||||
#- cloud:rax
|
||||
#- clustering
|
||||
#- database
|
||||
#- database:nosql
|
||||
#- database:sql
|
||||
#- development
|
||||
#- monitoring
|
||||
#- networking
|
||||
#- packaging
|
||||
- system
|
||||
#- web
|
||||
- name: fedora
|
||||
versions:
|
||||
- 31
|
||||
|
||||
- name: EL
|
||||
versions:
|
||||
- all
|
||||
- name: Fedora
|
||||
versions:
|
||||
- all
|
||||
- name: Ubuntu
|
||||
versions:
|
||||
- all
|
||||
- name: Debian
|
||||
versions:
|
||||
- all
|
||||
galaxy_tags:
|
||||
- system
|
||||
- lvm
|
||||
dependencies: []
|
||||
# List your role dependencies here, one per line.
|
||||
# Be sure to remove the '[]' above if you add dependencies
|
||||
# to this list.
|
||||
|
||||
29
molecule/default/converge.yml
Normal file
29
molecule/default/converge.yml
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
- name: Converge
|
||||
hosts: all
|
||||
vars:
|
||||
lvm_groups:
|
||||
- vgname: my_vg
|
||||
disks:
|
||||
- /dev/sdb1
|
||||
create: true
|
||||
lvnames:
|
||||
- lvname: my_lv
|
||||
size: 40%VG
|
||||
opts: "--wipesignatures y"
|
||||
create: true
|
||||
filesystem: ext4
|
||||
mount: true
|
||||
mntp: "/var/lib/mountpoint"
|
||||
- lvname: my_lw
|
||||
size: 20%VG
|
||||
opts: "--wipesignatures y"
|
||||
mount: true
|
||||
create: true
|
||||
filesystem: xfs
|
||||
mntp: "/var/lib/mountpoint2"
|
||||
manage_lvm: true
|
||||
tasks:
|
||||
- name: "Include lvm"
|
||||
include_role:
|
||||
name: "ansible-manage-lvm"
|
||||
42
molecule/default/molecule.yml
Normal file
42
molecule/default/molecule.yml
Normal file
@@ -0,0 +1,42 @@
|
||||
---
|
||||
driver:
|
||||
name: vagrant
|
||||
provider:
|
||||
name: virtualbox
|
||||
lint: |
|
||||
yamllint .
|
||||
ansible-lint
|
||||
flake8
|
||||
platforms:
|
||||
- name: CentOS-Molecule-LVM
|
||||
box: mrlesmithjr/centos7
|
||||
provider_override_args:
|
||||
- "persistent_storage.enabled = true"
|
||||
- "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.mount = false"
|
||||
- "persistent_storage.diskdevice = '/dev/sdb'"
|
||||
provisioner:
|
||||
name: ansible
|
||||
verifier:
|
||||
name: testinfra
|
||||
env:
|
||||
PYTHONWARNINGS: "ignore:.*U.*mode is deprecated:DeprecationWarning"
|
||||
options:
|
||||
v: 1
|
||||
21
molecule/default/tests/conftest.py
Normal file
21
molecule/default/tests/conftest.py
Normal file
@@ -0,0 +1,21 @@
|
||||
"""PyTest Fixtures."""
|
||||
from __future__ import absolute_import
|
||||
import os
|
||||
import pytest
|
||||
|
||||
|
||||
def pytest_runtest_setup(item):
|
||||
"""Run tests only when under molecule with testinfra installed."""
|
||||
try:
|
||||
import testinfra
|
||||
except ImportError:
|
||||
pytest.skip("Test requires testinfra", allow_module_level=True)
|
||||
if "MOLECULE_INVENTORY_FILE" in os.environ:
|
||||
pytest.testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
||||
os.environ["MOLECULE_INVENTORY_FILE"]
|
||||
).get_hosts("all")
|
||||
else:
|
||||
pytest.skip(
|
||||
"Test should run only from inside molecule.",
|
||||
allow_module_level=True
|
||||
)
|
||||
33
molecule/default/tests/test_default.py
Normal file
33
molecule/default/tests/test_default.py
Normal file
@@ -0,0 +1,33 @@
|
||||
"""Role testing files using testinfra."""
|
||||
|
||||
|
||||
def test_lvm_package_shall_be_installed(host):
|
||||
assert host.package("lvm2").is_installed
|
||||
|
||||
|
||||
def test_non_persistent_volume_group_is_created(host):
|
||||
command = """sudo vgdisplay | grep -c 'my_vg'"""
|
||||
cmd = host.run(command)
|
||||
assert '1' in cmd.stdout
|
||||
|
||||
|
||||
def test_mylv_logical_volume_is_created(host):
|
||||
command = """sudo lvs -o lv_name my_vg --separator='|' --noheadings \
|
||||
| grep -c 'my_lv'"""
|
||||
cmd = host.run(command)
|
||||
assert int(cmd.stdout.rstrip()) >= 1
|
||||
|
||||
|
||||
def test_mylv_logical_volume2_is_created(host):
|
||||
command = """sudo lvs -o lv_name my_vg --separator='|' --noheadings \
|
||||
| grep -c 'my_lw'"""
|
||||
cmd = host.run(command)
|
||||
assert int(cmd.stdout.rstrip()) >= 1
|
||||
|
||||
|
||||
def test_volume_is_mounted(host):
|
||||
host.file("/var/lib/mountpoint").mode == 0o731
|
||||
|
||||
|
||||
def test_volume2_is_mounted(host):
|
||||
host.file("/var/lib/mountpoint2").mode == 0o731
|
||||
29
molecule/kvm/converge.yml
Normal file
29
molecule/kvm/converge.yml
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
- name: Converge
|
||||
hosts: all
|
||||
vars:
|
||||
lvm_groups:
|
||||
- vgname: my_vg
|
||||
disks:
|
||||
- /dev/vdb
|
||||
create: true
|
||||
lvnames:
|
||||
- lvname: my_lv
|
||||
size: 40%VG
|
||||
opts: "--wipesignatures y"
|
||||
create: true
|
||||
filesystem: ext4
|
||||
mount: true
|
||||
mntp: "/var/lib/mountpoint"
|
||||
- lvname: my_lw
|
||||
size: 20%VG
|
||||
opts: "--wipesignatures y"
|
||||
mount: true
|
||||
create: true
|
||||
filesystem: xfs
|
||||
mntp: "/var/lib/mountpoint2"
|
||||
manage_lvm: true
|
||||
tasks:
|
||||
- name: "Include lvm"
|
||||
include_role:
|
||||
name: "ansible-manage-lvm"
|
||||
29
molecule/kvm/molecule.yml
Normal file
29
molecule/kvm/molecule.yml
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
driver:
|
||||
name: vagrant
|
||||
provider:
|
||||
name: libvirt
|
||||
lint: yamllint . && flake8 && ansible-lint
|
||||
platforms:
|
||||
- name: Fedora-Molecule-Volumes-KVM
|
||||
box: fedora/31-cloud-base
|
||||
cpu: 2
|
||||
memory: 2048
|
||||
provider_raw_config_args:
|
||||
- "storage :file, :size => '1G', :device => 'vdb'"
|
||||
provisioner:
|
||||
name: ansible
|
||||
config_options:
|
||||
defaults:
|
||||
forks: 20
|
||||
ssh_connection:
|
||||
pipelining: true
|
||||
ssh_args: -o ControlMaster=auto -o ControlPersist=600s
|
||||
verifier:
|
||||
name: testinfra
|
||||
env:
|
||||
PYTHONWARNINGS: "ignore:.*U.*mode is deprecated:DeprecationWarning"
|
||||
options:
|
||||
v: 1
|
||||
scenario:
|
||||
name: kvm
|
||||
1
molecule/kvm/tests
Symbolic link
1
molecule/kvm/tests
Symbolic link
@@ -0,0 +1 @@
|
||||
../default/tests
|
||||
14
molecule/kvmonlyvg/converge.yml
Normal file
14
molecule/kvmonlyvg/converge.yml
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
- name: Converge
|
||||
hosts: all
|
||||
vars:
|
||||
lvm_groups:
|
||||
- vgname: my_vg
|
||||
disks:
|
||||
- /dev/vdb
|
||||
create: true
|
||||
manage_lvm: true
|
||||
tasks:
|
||||
- name: "Include lvm"
|
||||
include_role:
|
||||
name: "ansible-manage-lvm"
|
||||
29
molecule/kvmonlyvg/molecule.yml
Normal file
29
molecule/kvmonlyvg/molecule.yml
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
driver:
|
||||
name: vagrant
|
||||
provider:
|
||||
name: libvirt
|
||||
lint: yamllint . && flake8 && ansible-lint
|
||||
platforms:
|
||||
- name: Fedora-Molecule-Volumes-KVM
|
||||
box: fedora/31-cloud-base
|
||||
cpu: 2
|
||||
memory: 2048
|
||||
provider_raw_config_args:
|
||||
- "storage :file, :size => '1G', :device => 'vdb'"
|
||||
provisioner:
|
||||
name: ansible
|
||||
config_options:
|
||||
defaults:
|
||||
forks: 20
|
||||
ssh_connection:
|
||||
pipelining: true
|
||||
ssh_args: -o ControlMaster=auto -o ControlPersist=600s
|
||||
verifier:
|
||||
name: testinfra
|
||||
env:
|
||||
PYTHONWARNINGS: "ignore:.*U.*mode is deprecated:DeprecationWarning"
|
||||
options:
|
||||
v: 1
|
||||
scenario:
|
||||
name: kvmonlyvg
|
||||
1
molecule/kvmonlyvg/tests/conftest.py
Symbolic link
1
molecule/kvmonlyvg/tests/conftest.py
Symbolic link
@@ -0,0 +1 @@
|
||||
../../default/tests/conftest.py
|
||||
11
molecule/kvmonlyvg/tests/test_default.py
Normal file
11
molecule/kvmonlyvg/tests/test_default.py
Normal file
@@ -0,0 +1,11 @@
|
||||
"""Role testing files using testinfra."""
|
||||
|
||||
|
||||
def test_lvm_package_shall_be_installed(host):
|
||||
assert host.package("lvm2").is_installed
|
||||
|
||||
|
||||
def test_non_persistent_volume_group_is_created(host):
|
||||
command = """sudo vgdisplay | grep -c 'my_vg'"""
|
||||
cmd = host.run(command)
|
||||
assert '1' in cmd.stdout
|
||||
22
molecule/kvmsinglelv/converge.yml
Normal file
22
molecule/kvmsinglelv/converge.yml
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
- name: Converge
|
||||
hosts: all
|
||||
vars:
|
||||
lvm_groups:
|
||||
- vgname: my_vg
|
||||
disks:
|
||||
- /dev/vdb
|
||||
create: true
|
||||
lvnames:
|
||||
- lvname: my_lv
|
||||
size: 40%VG
|
||||
opts: "--wipesignatures y"
|
||||
create: true
|
||||
filesystem: ext4
|
||||
mount: true
|
||||
mntp: "/var/lib/mountpoint"
|
||||
manage_lvm: true
|
||||
tasks:
|
||||
- name: "Include lvm"
|
||||
include_role:
|
||||
name: "ansible-manage-lvm"
|
||||
29
molecule/kvmsinglelv/molecule.yml
Normal file
29
molecule/kvmsinglelv/molecule.yml
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
driver:
|
||||
name: vagrant
|
||||
provider:
|
||||
name: libvirt
|
||||
lint: yamllint . && flake8 && ansible-lint
|
||||
platforms:
|
||||
- name: Fedora-Molecule-Volumes-KVM
|
||||
box: fedora/31-cloud-base
|
||||
cpu: 2
|
||||
memory: 2048
|
||||
provider_raw_config_args:
|
||||
- "storage :file, :size => '1G', :device => 'vdb'"
|
||||
provisioner:
|
||||
name: ansible
|
||||
config_options:
|
||||
defaults:
|
||||
forks: 20
|
||||
ssh_connection:
|
||||
pipelining: true
|
||||
ssh_args: -o ControlMaster=auto -o ControlPersist=600s
|
||||
verifier:
|
||||
name: testinfra
|
||||
env:
|
||||
PYTHONWARNINGS: "ignore:.*U.*mode is deprecated:DeprecationWarning"
|
||||
options:
|
||||
v: 1
|
||||
scenario:
|
||||
name: kvmsinglelv
|
||||
1
molecule/kvmsinglelv/tests/conftest.py
Symbolic link
1
molecule/kvmsinglelv/tests/conftest.py
Symbolic link
@@ -0,0 +1 @@
|
||||
../../default/tests/conftest.py
|
||||
22
molecule/kvmsinglelv/tests/test_default.py
Normal file
22
molecule/kvmsinglelv/tests/test_default.py
Normal file
@@ -0,0 +1,22 @@
|
||||
"""Role testing files using testinfra."""
|
||||
|
||||
|
||||
def test_lvm_package_shall_be_installed(host):
|
||||
assert host.package("lvm2").is_installed
|
||||
|
||||
|
||||
def test_non_persistent_volume_group_is_created(host):
|
||||
command = """sudo vgdisplay | grep -c 'my_vg'"""
|
||||
cmd = host.run(command)
|
||||
assert '1' in cmd.stdout
|
||||
|
||||
|
||||
def test_mylv_logical_volume_is_created(host):
|
||||
command = """sudo lvs -o lv_name my_vg --separator='|' --noheadings \
|
||||
| grep -c 'my_lv'"""
|
||||
cmd = host.run(command)
|
||||
assert int(cmd.stdout.rstrip()) >= 1
|
||||
|
||||
|
||||
def test_volume_is_mounted(host):
|
||||
host.file("/var/lib/mountpoint").mode == 0o731
|
||||
27
playbook.yml
Normal file
27
playbook.yml
Normal 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
|
||||
2143
poetry.lock
generated
Normal file
2143
poetry.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
30
pyproject.toml
Normal file
30
pyproject.toml
Normal file
@@ -0,0 +1,30 @@
|
||||
[tool.poetry]
|
||||
name = "ansible-manage-lvm"
|
||||
version = "0.1.0"
|
||||
description = ""
|
||||
authors = ["Larry Smith Jr. <mrlesmithjr@gmail.com>"]
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = "^3.10"
|
||||
ansible = "2.9.7"
|
||||
|
||||
[tool.poetry.dev-dependencies]
|
||||
bandit = "^1.7.1"
|
||||
black = "^21.11b1"
|
||||
flake8 = "^4.0.1"
|
||||
mypy = "^0.910"
|
||||
poetry = "^1.1.11"
|
||||
pylint = "^2.11.1"
|
||||
ansible-lint = "4.2.0"
|
||||
yamllint = "1.23.0"
|
||||
mkdocs = "^1.2.3"
|
||||
autopep8 = "^1.6.0"
|
||||
pycodestyle = "^2.8.0"
|
||||
pip-tools = "^6.4.0"
|
||||
molecule = "3.0.3"
|
||||
molecule-vagrant = "0.2"
|
||||
pre-commit = "^2.15.0"
|
||||
|
||||
[build-system]
|
||||
requires = ["poetry-core>=1.0.0"]
|
||||
build-backend = "poetry.core.masonry.api"
|
||||
112
requirements-dev.txt
Normal file
112
requirements-dev.txt
Normal file
@@ -0,0 +1,112 @@
|
||||
ansible-lint==4.2.0; (python_version >= "2.7" and python_full_version < "3.0.0") or (python_full_version >= "3.5.0")
|
||||
ansible==2.9.7; (python_version >= "2.7" and python_full_version < "3.0.0") or (python_full_version >= "3.5.0")
|
||||
arrow==1.2.1; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
|
||||
astroid==2.8.6; python_version >= "3.6" and python_version < "4.0"
|
||||
autopep8==1.6.0
|
||||
backports.entry-points-selectable==1.1.1; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "2.7"
|
||||
bandit==1.7.1; python_version >= "3.5"
|
||||
bcrypt==3.2.0; python_version >= "3.6"
|
||||
binaryornot==0.4.4; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
|
||||
black==21.11b1; python_full_version >= "3.6.2"
|
||||
cachecontrol==0.12.10; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
|
||||
cachy==0.3.0; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0"
|
||||
cerberus==1.3.2; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
|
||||
certifi==2021.10.8; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.6.0"
|
||||
cffi==1.15.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
|
||||
cfgv==3.3.1; python_full_version >= "3.6.1"
|
||||
chardet==4.0.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
|
||||
charset-normalizer==2.0.7; python_full_version >= "3.6.0" and python_version >= "3"
|
||||
cleo==0.8.1; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0"
|
||||
click-completion==0.5.2; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
|
||||
click-help-colors==0.9.1; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
|
||||
click==8.0.3; python_version >= "3.6" and python_full_version >= "3.6.2" and (python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6")
|
||||
clikit==0.6.2; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0"
|
||||
colorama==0.4.4; platform_system == "Windows" and python_version >= "3.6" and python_full_version >= "3.6.2" and python_version < "4.0" and sys_platform == "win32" and (python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6")
|
||||
cookiecutter==1.7.3; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
|
||||
crashtest==0.3.1; python_version >= "3.6" and python_version < "4.0" and (python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0")
|
||||
cryptography==36.0.0; python_version >= "3.6" and python_full_version < "3.0.0" and python_version < "4.0" and (python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0") and sys_platform == "linux" or python_full_version >= "3.5.0" and python_version >= "3.6" and python_version < "4.0" and (python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0") and sys_platform == "linux"
|
||||
distlib==0.3.3; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0"
|
||||
distro==1.6.0; python_version >= "3.6" and python_full_version < "3.0.0" and sys_platform == "linux" or python_version >= "3.6" and python_full_version < "3.0.0" and sys_platform == "linux2" or sys_platform == "linux" and python_version >= "3.6" and python_full_version >= "3.4.0" or sys_platform == "linux2" and python_version >= "3.6" and python_full_version >= "3.4.0"
|
||||
fasteners==0.16.3; python_version >= "3.6"
|
||||
filelock==3.4.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
|
||||
flake8==4.0.1; python_version >= "3.6"
|
||||
ghp-import==2.0.2; python_version >= "3.6"
|
||||
gitdb==4.0.9; python_version >= "3.7"
|
||||
gitpython==3.1.24; python_version >= "3.7"
|
||||
html5lib==1.1; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0"
|
||||
identify==2.4.0; python_full_version >= "3.6.1"
|
||||
idna==3.3; python_version >= "3.5" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.5"
|
||||
importlib-metadata==4.8.2; python_version >= "3.6"
|
||||
isort==5.10.1; python_full_version >= "3.6.1" and python_version < "4.0" and python_version >= "3.6"
|
||||
jeepney==0.7.1; python_version >= "3.6" and python_version < "4.0" and (python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0") and sys_platform == "linux"
|
||||
jinja2-time==0.2.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
|
||||
jinja2==3.0.3; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
|
||||
keyring==21.8.0; python_version >= "3.6" and python_version < "4.0" and (python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0")
|
||||
lazy-object-proxy==1.6.0; python_version >= "3.6" and python_full_version < "3.0.0" and python_version < "4.0" or python_version >= "3.6" and python_version < "4.0" and python_full_version >= "3.6.0"
|
||||
lockfile==0.12.2; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
|
||||
markdown==3.3.6; python_version >= "3.6"
|
||||
markupsafe==2.0.1; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
|
||||
mccabe==0.6.1; python_version >= "3.6" and python_version < "4.0"
|
||||
mergedeep==1.3.4; python_version >= "3.6"
|
||||
mkdocs==1.2.3; python_version >= "3.6"
|
||||
molecule-vagrant==0.2; (python_version >= "2.7" and python_full_version < "3.0.0") or (python_full_version >= "3.5.0")
|
||||
molecule==3.0.3; python_version >= "3.6"
|
||||
msgpack==1.0.2; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
|
||||
mypy-extensions==0.4.3; python_full_version >= "3.6.2" and python_version >= "3.5"
|
||||
mypy==0.910; python_version >= "3.5"
|
||||
nodeenv==1.6.0; python_full_version >= "3.6.1"
|
||||
packaging==20.9; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
|
||||
paramiko==2.8.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
|
||||
pastel==0.2.1; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0"
|
||||
pathspec==0.9.0; python_full_version >= "3.6.2" and python_version >= "3.6"
|
||||
pbr==5.8.0; python_version >= "3.6"
|
||||
pep517==0.12.0; python_version >= "3.6"
|
||||
pexpect==4.8.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
|
||||
pip-tools==6.4.0; python_version >= "3.6"
|
||||
pkginfo==1.8.1; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0"
|
||||
platformdirs==2.4.0; python_version >= "3.6" and python_full_version >= "3.6.2" and python_version < "4.0" and (python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6")
|
||||
pluggy==0.13.1; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
|
||||
poetry-core==1.0.7; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0"
|
||||
poetry==1.1.11; (python_version >= "2.7" and python_full_version < "3.0.0") or (python_full_version >= "3.5.0")
|
||||
poyo==0.5.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
|
||||
pre-commit==2.15.0; python_full_version >= "3.6.1"
|
||||
ptyprocess==0.7.0; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0"
|
||||
pycodestyle==2.8.0; (python_version >= "2.7" and python_full_version < "3.0.0") or (python_full_version >= "3.5.0")
|
||||
pycparser==2.21; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
|
||||
pyflakes==2.4.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6"
|
||||
pylev==1.4.0; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0"
|
||||
pylint==2.11.1; python_version >= "3.6" and python_version < "4.0"
|
||||
pynacl==1.4.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6"
|
||||
pyparsing==3.0.6; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
|
||||
python-dateutil==2.8.2; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
|
||||
python-gilt==1.2.3; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
|
||||
python-slugify==5.0.2; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
|
||||
python-vagrant==0.5.15; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0"
|
||||
pywin32-ctypes==0.2.0; python_version >= "3.6" and python_version < "4.0" and (python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0") and sys_platform == "win32"
|
||||
pyyaml-env-tag==0.1; python_version >= "3.6"
|
||||
pyyaml==5.4.1; python_full_version >= "3.6.1" and python_version >= "3.6" and (python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.6.0") and (python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.6")
|
||||
regex==2021.11.10; python_full_version >= "3.6.2"
|
||||
requests-toolbelt==0.9.1; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0"
|
||||
requests==2.26.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.6"
|
||||
ruamel.yaml==0.17.17; python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.7"
|
||||
secretstorage==3.3.1; python_version >= "3.6" and python_version < "4.0" and (python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0") and sys_platform == "linux"
|
||||
selinux==0.2.1; python_version >= "3.6" and python_full_version < "3.0.0" and sys_platform == "linux" or python_version >= "3.6" and python_full_version < "3.0.0" and sys_platform == "linux2" or sys_platform == "linux" and python_version >= "3.6" and python_full_version >= "3.5.0" or sys_platform == "linux2" and python_version >= "3.6" and python_full_version >= "3.5.0"
|
||||
sh==1.14.2; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
|
||||
shellingham==1.4.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_version >= "3.6" and python_full_version >= "3.5.0"
|
||||
six==1.16.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
|
||||
smmap==5.0.0; python_version >= "3.7"
|
||||
stevedore==3.5.0; python_version >= "3.6"
|
||||
tabulate==0.8.9; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
|
||||
text-unidecode==1.3; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
|
||||
toml==0.10.2; python_full_version >= "3.6.1" and python_version >= "3.6" and python_version < "4.0"
|
||||
tomli==1.2.2; python_version >= "3.6" and python_full_version >= "3.6.2"
|
||||
tomlkit==0.7.2; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0"
|
||||
tree-format==0.1.2; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
|
||||
typing-extensions==4.0.0
|
||||
urllib3==1.26.7; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version < "4"
|
||||
virtualenv==20.10.0; python_full_version >= "3.6.1"
|
||||
watchdog==2.1.6; python_version >= "3.6"
|
||||
webencodings==0.5.1; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0"
|
||||
wrapt==1.13.3; python_version >= "3.6" and python_full_version < "3.0.0" and python_version < "4.0" or python_version >= "3.6" and python_version < "4.0" and python_full_version >= "3.5.0"
|
||||
yamllint==1.23.0; (python_version >= "2.7" and python_full_version < "3.0.0") or (python_full_version >= "3.4.0")
|
||||
zipp==3.6.0; python_version >= "3.6"
|
||||
7
requirements.txt
Normal file
7
requirements.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
ansible==2.9.7; (python_version >= "2.7" and python_full_version < "3.0.0") or (python_full_version >= "3.5.0")
|
||||
cffi==1.15.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
|
||||
cryptography==36.0.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
|
||||
jinja2==3.0.3; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
|
||||
markupsafe==2.0.1; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
|
||||
pycparser==2.21; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
|
||||
pyyaml==5.4.1; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.6.0"
|
||||
70
tasks/amazon.yml
Normal file
70
tasks/amazon.yml
Normal file
@@ -0,0 +1,70 @@
|
||||
---
|
||||
|
||||
- name: amazon | check for nvme devices
|
||||
shell: |
|
||||
set -o pipefail
|
||||
cat /proc/partitions | awk '{print $4}' | grep -q nvme. ; echo $?
|
||||
args:
|
||||
executable: /bin/bash
|
||||
register: blkdev_nvme
|
||||
changed_when: false
|
||||
|
||||
- name: amazon | check for amazon ebs devices
|
||||
shell: |
|
||||
set -o pipefail
|
||||
lsblk -O -J | grep -qi "amazon elastic block store" ; echo $?
|
||||
register: blkdev_awsebs
|
||||
changed_when: false
|
||||
args:
|
||||
executable: /bin/bash
|
||||
|
||||
- name: amazon | set flag for nvme subsystem
|
||||
set_fact:
|
||||
device_is_nvme: "{{ true if (blkdev_nvme.stdout == '0') else false }}"
|
||||
|
||||
- name: amazon | set flag for aws ebs devices
|
||||
set_fact:
|
||||
device_is_awsebs: "{{ true if (blkdev_awsebs.stdout == '0') else false }}"
|
||||
|
||||
- name: Block to map renamed ec2 ebs nvmeXnY devices to their original sdX/xvdX names
|
||||
when: device_is_nvme and device_is_awsebs|bool
|
||||
become: true
|
||||
block:
|
||||
- name: amazon | download nvme mapping binary helper
|
||||
get_url:
|
||||
url: "{{ ebsnvme_binary_helper_url }}"
|
||||
dest: "{{ ebsnvme_binary_helper_tmp }}/"
|
||||
changed_when: false
|
||||
|
||||
- name: amazon | extract binary helper
|
||||
unarchive:
|
||||
src: "{{ ebsnvme_binary_helper_tmp }}/{{ ebsnvme_binary_helper_file }}"
|
||||
dest: "{{ ebsnvme_binary_helper_tmp }}/"
|
||||
remote_src: yes
|
||||
mode: 0755
|
||||
changed_when: false
|
||||
|
||||
- name: amazon | copy binary helper
|
||||
copy:
|
||||
src: "{{ ebsnvme_binary_helper_tmp }}/go-ebsnvme"
|
||||
dest: "{{ ebsnvme_binary_helper_path }}"
|
||||
mode: a+x
|
||||
remote_src: yes
|
||||
|
||||
- name: amazon | template script helper
|
||||
template:
|
||||
src: 'ebsnvme-id.j2'
|
||||
dest: "{{ ebsnvme_scrip_helper_path }}"
|
||||
mode: a+x
|
||||
|
||||
- name: amazon | template udev rule
|
||||
template:
|
||||
src: '70-ec2-nvme-devices.rules.j2'
|
||||
dest: '/etc/udev/rules.d/70-ec2-nvme-devices.rules'
|
||||
mode: 0755
|
||||
register: udev_rule
|
||||
|
||||
- name: amazon | reload and trigger udev rules
|
||||
shell:
|
||||
cmd: udevadm control --reload-rules && udevadm trigger
|
||||
when: udev_rule.changed
|
||||
@@ -1,19 +1,57 @@
|
||||
---
|
||||
- name: centos | installing lvm2
|
||||
yum:
|
||||
package:
|
||||
name: lvm2
|
||||
state: present
|
||||
become: true
|
||||
|
||||
- include_tasks: amazon.yml
|
||||
when: ansible_facts.system_vendor == 'Amazon EC2'
|
||||
|
||||
- name: centos | installing sg3_utils
|
||||
yum:
|
||||
package:
|
||||
name: sg3_utils
|
||||
state: present
|
||||
become: true
|
||||
|
||||
- name: centos | debug lvg
|
||||
debug:
|
||||
var: lv
|
||||
verbosity: 3
|
||||
loop: "{{ lookup('subelements', lvm_groups, 'lvnames', {'skip_missing': True}, wantlist=True) }}"
|
||||
loop_control:
|
||||
loop_var: lv
|
||||
|
||||
- name: centos | install xfs tools
|
||||
package:
|
||||
name: "xfsprogs"
|
||||
state: "present"
|
||||
become: true
|
||||
loop: "{{ lookup('subelements', lvm_groups, 'lvnames', {'skip_missing': True}, wantlist=True) }}"
|
||||
loop_control:
|
||||
loop_var: lv
|
||||
when:
|
||||
- lv.1 is defined
|
||||
- lv.1 != "None"
|
||||
- lv.1.filesystem is defined
|
||||
- lv.1.filesystem == "xfs"
|
||||
- lv.1.create is defined
|
||||
- lv.1.create|bool
|
||||
|
||||
- name: centos | checking for scsi devices
|
||||
shell: sg_scan
|
||||
command: sg_scan
|
||||
become: true
|
||||
register: scsi_devices
|
||||
changed_when: False
|
||||
changed_when: false
|
||||
|
||||
- name: centos | rescanning for new disks
|
||||
command: /usr/bin/rescan-scsi-bus.sh
|
||||
changed_when: False
|
||||
become: true
|
||||
changed_when: false
|
||||
when: scsi_devices.stdout|length > 0
|
||||
|
||||
- name: centos | rescanning for resized disks
|
||||
command: /usr/bin/rescan-scsi-bus.sh -s
|
||||
become: true
|
||||
changed_when: false
|
||||
when: scsi_devices.stdout|length > 0
|
||||
|
||||
96
tasks/create_fs.yml
Normal file
96
tasks/create_fs.yml
Normal file
@@ -0,0 +1,96 @@
|
||||
---
|
||||
|
||||
# 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
|
||||
# then it tries to recreate the fs on the mounted fs which indeed fails...
|
||||
shell: "xfs_info {{ lv.mntp }} | grep -c 'ftype=1'"
|
||||
become: yes
|
||||
register: mountedxfs
|
||||
ignore_errors: true
|
||||
changed_when: false
|
||||
when:
|
||||
- lv is defined and lv != 'None'
|
||||
- lv.filesystem is defined
|
||||
- lv.filesystem == "xfs"
|
||||
- lv.create is defined
|
||||
- lv.create|bool
|
||||
|
||||
- name: create_fs | unmounting filesystem(s)
|
||||
mount:
|
||||
path: "{{ lv.mntp }}"
|
||||
src: "/dev/{{ vg.vgname }}/{{ lv.lvname }}"
|
||||
fstype: "{{ lv.filesystem | default(omit) }}"
|
||||
state: absent
|
||||
become: true
|
||||
when:
|
||||
- lv is defined
|
||||
- lv != 'None'
|
||||
- lv.create is defined
|
||||
- not lv.create|bool
|
||||
- lv.filesystem != "swap"
|
||||
|
||||
- name: create_fs | creating new filesystem on new LVM logical volume(s)
|
||||
filesystem:
|
||||
fstype: "{{ lv.filesystem }}"
|
||||
dev: "/dev/{{ vg.vgname }}/{{ lv.lvname }}"
|
||||
resizefs: yes
|
||||
become: true
|
||||
when:
|
||||
- vg.create is defined
|
||||
- vg.create|bool
|
||||
- lv is defined
|
||||
- lv != 'None'
|
||||
- lv.create is defined
|
||||
- lv.create|bool
|
||||
- lv.filesystem is defined
|
||||
- lv.filesystem != 'None'
|
||||
- lv.filesystem != 'xfs'
|
||||
|
||||
- name: create_fs | creating new xfs filesystem on new LVM logical volume(s)
|
||||
filesystem:
|
||||
fstype: "{{ lv.filesystem }}"
|
||||
dev: "/dev/{{ vg.vgname }}/{{ lv.lvname }}"
|
||||
become: true
|
||||
when:
|
||||
- mountedxfs is failed
|
||||
- vg.create is defined
|
||||
- vg.create|bool
|
||||
- lv is defined
|
||||
- lv != 'None'
|
||||
- lv.create is defined
|
||||
- lv.create|bool
|
||||
- lv.filesystem is defined
|
||||
- lv.filesystem == 'xfs'
|
||||
|
||||
- name: create_fs | mounting new filesystem(s)
|
||||
mount:
|
||||
path: "{{ lv.mntp }}"
|
||||
src: "/dev/{{ vg.vgname }}/{{ lv.lvname }}"
|
||||
fstype: "{{ lv.filesystem }}"
|
||||
state: mounted
|
||||
opts: "{{ lv.mopts | default('defaults') }}"
|
||||
become: true
|
||||
when:
|
||||
- vg.create is defined
|
||||
- vg.create|bool
|
||||
- lv is defined
|
||||
- lv != 'None'
|
||||
- lv.create is defined
|
||||
- lv.create|bool
|
||||
- lv.mount is defined
|
||||
- lv.mount|bool
|
||||
|
||||
- name: create_fs | resizing xfs filesystem on new LVM logical volume(s)
|
||||
command: "xfs_growfs {{ lv.mntp }}"
|
||||
become: true
|
||||
when:
|
||||
- vg.create is defined
|
||||
- vg.create|bool
|
||||
- lv is defined
|
||||
- lv != 'None'
|
||||
- lv.create is defined
|
||||
- lv.create|bool
|
||||
- lv.filesystem is defined
|
||||
- lv.filesystem == 'xfs'
|
||||
- lvchanged.changed
|
||||
31
tasks/create_lv.yml
Normal file
31
tasks/create_lv.yml
Normal file
@@ -0,0 +1,31 @@
|
||||
---
|
||||
|
||||
- name: create_lv | Display Volume Group
|
||||
debug:
|
||||
var: vg
|
||||
verbosity: 2
|
||||
|
||||
- name: create_lv | creating new LVM logical volume(s)
|
||||
lvol:
|
||||
vg: "{{ vg.vgname }}"
|
||||
lv: "{{ lv.lvname }}"
|
||||
size: "{{ lv.size }}"
|
||||
shrink: false
|
||||
opts: "{{ lv.opts | default('') }}"
|
||||
state: present
|
||||
become: true
|
||||
register: lvchanged
|
||||
when:
|
||||
- vg.create is defined
|
||||
- vg.create|bool
|
||||
- lv is defined
|
||||
- lv != 'None'
|
||||
- lv.create is defined
|
||||
- lv.create|bool
|
||||
|
||||
- name: create_lv | debug changed attribute
|
||||
debug:
|
||||
var: lvchanged
|
||||
|
||||
- name: create_lv | configuring FS
|
||||
include_tasks: create_fs.yml
|
||||
29
tasks/create_vg.yml
Normal file
29
tasks/create_vg.yml
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
- name: create_vg | creating new LVM volume group(s)
|
||||
lvg:
|
||||
vg: "{{ vg.vgname }}"
|
||||
pvs: "{{ vg.disks | join(',') }}"
|
||||
state: present
|
||||
become: true
|
||||
when:
|
||||
- vg.create is defined
|
||||
- vg.create|bool
|
||||
|
||||
### workaround: auto pvresize waiting for upgrade to new module supporting integrated pvresize
|
||||
### ref: https://docs.ansible.com/ansible/3/collections/community/general/lvg_module.html
|
||||
- name: create_vg | pvresize to max available free space
|
||||
command: "pvresize {{ pv }}"
|
||||
loop: "{{ vg.disks | default([]) }}"
|
||||
loop_control:
|
||||
loop_var: pv
|
||||
changed_when: false
|
||||
when:
|
||||
- vg.create is defined
|
||||
- vg.create|bool
|
||||
- pvresize_to_max|bool
|
||||
|
||||
- name: manage_lvm | loop over logical volume group(s) to create logical volumes
|
||||
include_tasks: create_lv.yml
|
||||
loop: "{{ vg.lvnames | default([]) }}"
|
||||
loop_control:
|
||||
loop_var: lv
|
||||
@@ -1,19 +1,40 @@
|
||||
---
|
||||
- name: debian | Updating Apt Cache
|
||||
apt:
|
||||
update_cache: true
|
||||
cache_valid_time: 3600
|
||||
become: true
|
||||
|
||||
- name: debian | installing pre-reqs
|
||||
apt:
|
||||
name: "{{ item }}"
|
||||
name:
|
||||
- lvm2
|
||||
- scsitools
|
||||
state: present
|
||||
with_items:
|
||||
- lvm2
|
||||
- scsitools
|
||||
- xfsprogs
|
||||
become: true
|
||||
|
||||
- name: debian | install xfs tools
|
||||
apt:
|
||||
name: xfsprogs
|
||||
state: present
|
||||
become: true
|
||||
loop: "{{ lvm_groups|subelements('lvnames') }}"
|
||||
when:
|
||||
- item.1 is defined
|
||||
- item.1 != 'None'
|
||||
- item.1.filesystem is defined
|
||||
- item.1.filesystem == "xfs"
|
||||
- item.1.create is defined
|
||||
- item.1.create|bool
|
||||
|
||||
- name: debian | checking for scsi devices
|
||||
shell: sg_scan
|
||||
command: sg_scan
|
||||
become: true
|
||||
register: scsi_devices
|
||||
changed_when: False
|
||||
changed_when: false
|
||||
|
||||
- name: debian | rescanning for new disks added
|
||||
command: /sbin/rescan-scsi-bus
|
||||
changed_when: False
|
||||
when: scsi_devices.stdout != ""
|
||||
become: true
|
||||
changed_when: false
|
||||
when: scsi_devices['stdout'] | length
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
---
|
||||
# tasks file for ansible-manage-lvm
|
||||
- include: debian.yml
|
||||
when: ansible_os_family == "Debian"
|
||||
- include_tasks: debian.yml
|
||||
when: ansible_facts.os_family == "Debian"
|
||||
|
||||
- include: centos.yml
|
||||
when: ansible_os_family == "RedHat"
|
||||
- include_tasks: centos.yml
|
||||
when: ansible_facts.os_family == "RedHat"
|
||||
|
||||
- include: manage_lvm.yml
|
||||
when: manage_lvm is defined and manage_lvm
|
||||
- include_tasks: manage_lvm.yml
|
||||
when:
|
||||
- lvm_groups is defined
|
||||
- manage_lvm|bool
|
||||
|
||||
@@ -1,93 +1,31 @@
|
||||
---
|
||||
- name: manage_lvm | creating new LVM volume group(s)
|
||||
lvg:
|
||||
vg: "{{ item.vgname }}"
|
||||
pvs: "{{ item.disks }}"
|
||||
state: present
|
||||
with_items: "{{ lvm_groups }}"
|
||||
when: item.create is defined and item.create
|
||||
|
||||
- name: manage_lvm | creating new LVM logical volume(s)
|
||||
lvol:
|
||||
vg: "{{ item.0.vgname }}"
|
||||
lv: "{{ item.1.lvname }}"
|
||||
size: "{{ item.1.size }}"
|
||||
shrink: no
|
||||
state: present
|
||||
register: lvm
|
||||
with_subelements:
|
||||
- "{{ lvm_groups }}"
|
||||
- lvnames
|
||||
when: ( item.0.create is defined and item.0.create ) and ( item.1 is defined and item.1 != 'None' ) and ( item.1.create is defined and item.1.create )
|
||||
|
||||
- name: manage_lvm | creating new filesystem on new LVM logical volume(s)
|
||||
filesystem:
|
||||
fstype: "{{ item.1.filesystem }}"
|
||||
dev: "/dev/{{ item.0.vgname }}/{{ item.1.lvname }}"
|
||||
# resizefs: yes #coming in 2.0 which will replace the resizing filesystem task below
|
||||
with_subelements:
|
||||
- "{{ lvm_groups }}"
|
||||
- lvnames
|
||||
when: ( item.0.create is defined and item.0.create ) and ( item.1 is defined and item.1 != 'None' ) and ( item.1.create is defined and item.1.create )
|
||||
|
||||
- name: manage_lvm | mounting new filesystem(s)
|
||||
mount:
|
||||
name: "{{ item.1.mntp }}"
|
||||
src: "/dev/{{ item.0.vgname }}/{{ item.1.lvname }}"
|
||||
fstype: "{{ item.1.filesystem }}"
|
||||
state: mounted
|
||||
with_subelements:
|
||||
- "{{ lvm_groups }}"
|
||||
- lvnames
|
||||
when: ( item.0.create is defined and item.0.create ) and ( item.1 is defined and item.1 != 'None' ) and ( item.1.create is defined and item.1.create ) and ( item.1.mount is defined and item.1.mount )
|
||||
|
||||
- name: manage_lvm | resizing filesystem
|
||||
command: resize2fs /dev/{{ item.0.vgname }}/{{ item.1.lvname }}
|
||||
with_subelements:
|
||||
- "{{ lvm_groups }}"
|
||||
- lvnames
|
||||
when: lvm.changed and item.1.filesystem != "swap" and item.1.filesystem != "xfs"
|
||||
|
||||
- name: manage_lvm | resizing xfs
|
||||
command: xfs_growfs -d /dev/{{ item.0.vgname }}/{{ item.1.lvname }}
|
||||
with_subelements:
|
||||
- "{{ lvm_groups }}"
|
||||
- lvnames
|
||||
when: lvm.changed and item.1.filesystem == "xfs"
|
||||
|
||||
- name: manage_lvm | resizing swap
|
||||
shell: "swapoff -a && mkswap /dev/{{ item.0.vgname }}/{{ item.1.lvname }} && swapon -va"
|
||||
with_subelements:
|
||||
- "{{ lvm_groups }}"
|
||||
- lvnames
|
||||
when: lvm.changed and item.1.filesystem == "swap"
|
||||
|
||||
- name: manage_lvm | unmounting filesystem(s)
|
||||
mount:
|
||||
name: "{{ item.1.mntp }}"
|
||||
src: "/dev/{{ item.0.vgname }}/{{ item.1.lvname }}"
|
||||
fstype: "{{ item.1.filesystem }}"
|
||||
state: absent
|
||||
with_subelements:
|
||||
- "{{ lvm_groups }}"
|
||||
- lvnames
|
||||
when: ( item.1 is defined and item.1 != 'None' ) and ( item.1.create is defined and not item.1.create )
|
||||
- name: manage_lvm | manage physical volume group creation
|
||||
include_tasks: create_vg.yml
|
||||
loop: "{{ lvm_groups }}"
|
||||
loop_control:
|
||||
loop_var: vg
|
||||
|
||||
- name: manage_lvm | Removing LVM logical volume(s)
|
||||
lvol:
|
||||
vg: "{{ item.0.vgname }}"
|
||||
lv: "{{ item.1.lvname }}"
|
||||
state: absent
|
||||
force: yes
|
||||
with_subelements:
|
||||
- "{{ lvm_groups }}"
|
||||
- lvnames
|
||||
when: ( item.1 is defined and item.1 != 'None' ) and ( item.1.create is defined and not item.1.create )
|
||||
force: true
|
||||
become: true
|
||||
loop: "{{ lvm_groups|subelements('lvnames', {'skip_missing': true}) }}"
|
||||
when:
|
||||
- item.1 is defined
|
||||
- item.1 != 'None'
|
||||
- item.1.create is defined
|
||||
- not item.1.create|bool
|
||||
|
||||
- name: manage_lvm | Removing LVM volume group(s)
|
||||
lvg:
|
||||
vg: "{{ item.vgname }}"
|
||||
pvs: "{{ item.disks }}"
|
||||
pvs: "{{ item.disks | join(',') }}"
|
||||
state: absent
|
||||
with_items: "{{ lvm_groups }}"
|
||||
when: item.create is defined and not item.create
|
||||
become: true
|
||||
loop: "{{ lvm_groups }}"
|
||||
when:
|
||||
- item.create is defined
|
||||
- not item.create|bool
|
||||
|
||||
3
templates/70-ec2-nvme-devices.rules.j2
Normal file
3
templates/70-ec2-nvme-devices.rules.j2
Normal file
@@ -0,0 +1,3 @@
|
||||
# ebs nvme to scsi device naming mapping
|
||||
KERNEL=="nvme[0-9]*n[0-9]*", ENV{DEVTYPE}=="disk", ATTRS{model}=="Amazon Elastic Block Store", PROGRAM="{{ ebsnvme_scrip_helper_path }} /dev/%k", SYMLINK+="%c"
|
||||
|
||||
15
templates/ebsnvme-id.j2
Normal file
15
templates/ebsnvme-id.j2
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
# This script uses go version of ebsnvme-id to provide
|
||||
# SCSI Disk device name links for nvme devices
|
||||
#
|
||||
# links:
|
||||
#
|
||||
# https://www.logicworks.com/blog/2018/03/manage-aws-ebs-volumes-c5-m5-puppet-chef-ansible/
|
||||
# https://github.com/mvisonneau/go-ebsnvme
|
||||
# https://gist.github.com/lbernail/d851e5b06eb32180a4b8ead2ce4f45db
|
||||
# and working forks like:
|
||||
# (keenan-v1/ebsnvme-id) https://gist.github.com/keenan-v1/aee92cd7383ee02de2a817a004917a03
|
||||
#
|
||||
|
||||
{{ ebsnvme_binary_helper_path }} -n $1 | awk -F '/' '{print $3}'
|
||||
|
||||
1
tests/.ansible-lint
Normal file
1
tests/.ansible-lint
Normal file
@@ -0,0 +1 @@
|
||||
skip_list: ['305','503','602']
|
||||
27
tests/Dockerfile.centos-7
Normal file
27
tests/Dockerfile.centos-7
Normal file
@@ -0,0 +1,27 @@
|
||||
FROM centos:7
|
||||
ENV container=docker
|
||||
|
||||
RUN yum -y install epel-release && \
|
||||
yum -y install gmp-devel libffi-devel openssl-devel python-crypto \
|
||||
python-devel python-pip python-setuptools python-virtualenv \
|
||||
redhat-rpm-config && \
|
||||
yum -y group install "Development Tools"
|
||||
|
||||
# Install systemd -- See https://hub.docker.com/_/centos/
|
||||
RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \
|
||||
rm -f /lib/systemd/system/multi-user.target.wants/*;\
|
||||
rm -f /etc/systemd/system/*.wants/*;\
|
||||
rm -f /lib/systemd/system/local-fs.target.wants/*; \
|
||||
rm -f /lib/systemd/system/sockets.target.wants/*udev*; \
|
||||
rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \
|
||||
rm -f /lib/systemd/system/basic.target.wants/*;\
|
||||
rm -f /lib/systemd/system/anaconda.target.wants/*;
|
||||
|
||||
RUN pip install enum34 ipaddress wheel && \
|
||||
pip install ansible ansible-lint
|
||||
|
||||
COPY .ansible-lint /
|
||||
|
||||
VOLUME ["/sys/fs/cgroup"]
|
||||
|
||||
CMD ["/usr/sbin/init"]
|
||||
13
tests/Dockerfile.debian-stretch
Normal file
13
tests/Dockerfile.debian-stretch
Normal file
@@ -0,0 +1,13 @@
|
||||
FROM debian:stretch
|
||||
ENV container=docker
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends build-essential libffi-dev \
|
||||
libssl-dev python-dev python-minimal python-pip python-setuptools \
|
||||
python-virtualenv systemd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN pip install enum34 ipaddress wheel && \
|
||||
pip install ansible ansible-lint
|
||||
|
||||
COPY .ansible-lint /
|
||||
26
tests/Dockerfile.fedora-25
Normal file
26
tests/Dockerfile.fedora-25
Normal file
@@ -0,0 +1,26 @@
|
||||
FROM fedora:25
|
||||
ENV container=docker
|
||||
|
||||
RUN dnf -y install gmp-devel libffi-devel openssl-devel python-crypto \
|
||||
python-devel python-dnf python-pip python-setuptools python-virtualenv \
|
||||
redhat-rpm-config systemd && \
|
||||
dnf -y group install "C Development Tools and Libraries"
|
||||
|
||||
# Install systemd -- See https://hub.docker.com/_/centos/
|
||||
RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \
|
||||
rm -f /lib/systemd/system/multi-user.target.wants/*;\
|
||||
rm -f /etc/systemd/system/*.wants/*;\
|
||||
rm -f /lib/systemd/system/local-fs.target.wants/*; \
|
||||
rm -f /lib/systemd/system/sockets.target.wants/*udev*; \
|
||||
rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \
|
||||
rm -f /lib/systemd/system/basic.target.wants/*;\
|
||||
rm -f /lib/systemd/system/anaconda.target.wants/*;
|
||||
|
||||
RUN pip install enum34 ipaddress wheel && \
|
||||
pip install ansible ansible-lint
|
||||
|
||||
COPY .ansible-lint /
|
||||
|
||||
VOLUME ["/sys/fs/cgroup"]
|
||||
|
||||
CMD ["/usr/sbin/init"]
|
||||
26
tests/Dockerfile.fedora-26
Normal file
26
tests/Dockerfile.fedora-26
Normal file
@@ -0,0 +1,26 @@
|
||||
FROM fedora:26
|
||||
ENV container=docker
|
||||
|
||||
RUN dnf -y install gmp-devel libffi-devel openssl-devel python-crypto \
|
||||
python-devel python-dnf python-pip python-setuptools python-virtualenv \
|
||||
redhat-rpm-config systemd && \
|
||||
dnf -y group install "C Development Tools and Libraries"
|
||||
|
||||
# Install systemd -- See https://hub.docker.com/_/centos/
|
||||
RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \
|
||||
rm -f /lib/systemd/system/multi-user.target.wants/*;\
|
||||
rm -f /etc/systemd/system/*.wants/*;\
|
||||
rm -f /lib/systemd/system/local-fs.target.wants/*; \
|
||||
rm -f /lib/systemd/system/sockets.target.wants/*udev*; \
|
||||
rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \
|
||||
rm -f /lib/systemd/system/basic.target.wants/*;\
|
||||
rm -f /lib/systemd/system/anaconda.target.wants/*;
|
||||
|
||||
RUN pip install enum34 ipaddress wheel && \
|
||||
pip install ansible ansible-lint
|
||||
|
||||
COPY .ansible-lint /
|
||||
|
||||
VOLUME ["/sys/fs/cgroup"]
|
||||
|
||||
CMD ["/usr/sbin/init"]
|
||||
13
tests/Dockerfile.ubuntu-bionic
Normal file
13
tests/Dockerfile.ubuntu-bionic
Normal file
@@ -0,0 +1,13 @@
|
||||
FROM ubuntu:bionic
|
||||
ENV container=docker
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends build-essential libffi-dev \
|
||||
libssl-dev python-dev python-minimal python-pip python-setuptools \
|
||||
python-virtualenv systemd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN pip install enum34 ipaddress wheel && \
|
||||
pip install ansible ansible-lint
|
||||
|
||||
COPY .ansible-lint /
|
||||
13
tests/Dockerfile.ubuntu-xenial
Normal file
13
tests/Dockerfile.ubuntu-xenial
Normal file
@@ -0,0 +1,13 @@
|
||||
FROM ubuntu:xenial
|
||||
ENV container=docker
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends build-essential libffi-dev \
|
||||
libssl-dev python-dev python-minimal python-pip python-setuptools \
|
||||
python-virtualenv && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN pip install enum34 ipaddress wheel && \
|
||||
pip install ansible ansible-lint
|
||||
|
||||
COPY .ansible-lint /
|
||||
1
tests/inventory
Normal file
1
tests/inventory
Normal file
@@ -0,0 +1 @@
|
||||
localhost
|
||||
5
tests/test.yml
Normal file
5
tests/test.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
connection: local
|
||||
roles:
|
||||
- ansible-manage-lvm
|
||||
@@ -1,2 +1,5 @@
|
||||
---
|
||||
# vars file for ansible-manage-lvm
|
||||
|
||||
ebsnvme_binary_helper_file: go-ebsnvme_{{ ebsnvme_binary_helper_ver }}_linux_amd64.tar.gz
|
||||
ebsnvme_binary_helper_url: https://github.com/mvisonneau/go-ebsnvme/releases/download/{{ ebsnvme_binary_helper_ver }}/{{ ebsnvme_binary_helper_file }}
|
||||
|
||||
Reference in New Issue
Block a user