mirror of
https://github.com/mrlesmithjr/ansible-manage-lvm.git
synced 2026-09-05 15:08:12 +03:00
Compare commits
30 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 84ba07bcaf | |||
| a623248cdf | |||
| 55b1745ac3 | |||
| c020c6ef2d | |||
| 47c980797d | |||
| d6dd5184f0 | |||
| 74e7ca5652 | |||
| 12346fa038 | |||
| 8dc044f7c2 | |||
| aa66814872 | |||
| 6e4f217d74 | |||
| 483ed18874 | |||
| ea2e60f043 | |||
| a28791cc48 | |||
| b5bf2d266c | |||
| ca903442c8 | |||
| 9e69c74f71 | |||
| e9ff7e3faf | |||
| 84bfdf54ad | |||
| 376f2ce641 | |||
| 6e74c9714e | |||
| 1f966d2ea1 | |||
| 71a3930e5b | |||
| 263c8d2b3f | |||
| 0bfd390ace | |||
| 71bc56d733 | |||
| 59ca2aae95 | |||
| cb3a75c984 | |||
| fae4332de8 | |||
| 558cd7460e |
@@ -10,25 +10,21 @@ on:
|
|||||||
- develop
|
- develop
|
||||||
- main
|
- main
|
||||||
- master
|
- master
|
||||||
|
|
||||||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
build:
|
||||||
# The type of runner that the job will run on
|
runs-on: ubuntu-latest
|
||||||
runs-on: macos-10.15
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
max-parallel: 4
|
max-parallel: 4
|
||||||
matrix:
|
matrix:
|
||||||
python-version: [3.8]
|
python-version: [3.9]
|
||||||
|
|
||||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
- name: Set up Python ${{ matrix.python-version }}
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
- uses: actions/cache@v2
|
- uses: actions/cache@v2
|
||||||
|
|||||||
@@ -32,3 +32,5 @@ Larry Smith Jr.
|
|||||||
- [@mrlesmithjr](https://twitter.com/mrlesmithjr)
|
- [@mrlesmithjr](https://twitter.com/mrlesmithjr)
|
||||||
- [mrlesmithjr@gmail.com](mailto:mrlesmithjr@gmail.com)
|
- [mrlesmithjr@gmail.com](mailto:mrlesmithjr@gmail.com)
|
||||||
- [http://everythingshouldbevirtual.com](http://everythingshouldbevirtual.com)
|
- [http://everythingshouldbevirtual.com](http://everythingshouldbevirtual.com)
|
||||||
|
|
||||||
|
<a href="https://www.buymeacoffee.com/mrlesmithjr" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>
|
||||||
|
|||||||
@@ -31,6 +31,8 @@ lvm_groups: []
|
|||||||
# size: 40g
|
# size: 40g
|
||||||
# create: true
|
# create: true
|
||||||
# filesystem: ext4
|
# filesystem: ext4
|
||||||
|
# # Defines options passed to the filesystem creation command
|
||||||
|
# fsopts:
|
||||||
# mount: true
|
# mount: true
|
||||||
# mntp: /
|
# mntp: /
|
||||||
# - vgname: test-vg
|
# - vgname: test-vg
|
||||||
@@ -57,6 +59,20 @@ lvm_groups: []
|
|||||||
# lvnames:
|
# lvnames:
|
||||||
# # Set to None to only create LVM VG w/out creating LVM LVOLS
|
# # Set to None to only create LVM VG w/out creating LVM LVOLS
|
||||||
# - None
|
# - None
|
||||||
|
# # Using fsopts to create a docker compatible xfs volume
|
||||||
|
# - vgname: docker-volumes
|
||||||
|
# disks:
|
||||||
|
# - /dev/vdc
|
||||||
|
# - /dev/vdd
|
||||||
|
# create: true
|
||||||
|
# lvnames:
|
||||||
|
# - lvname: docker_1
|
||||||
|
# size: 100%FREE
|
||||||
|
# create: true
|
||||||
|
# filesystem: xfs
|
||||||
|
# fsopts: -n ftype=1
|
||||||
|
# mount: true
|
||||||
|
# mntp: /var/lib/docker
|
||||||
|
|
||||||
# Defines if LVM will be managed by role
|
# Defines if LVM will be managed by role
|
||||||
# default is false to ensure nothing is changed by accident.
|
# default is false to ensure nothing is changed by accident.
|
||||||
|
|||||||
Generated
+1435
-1327
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -6,7 +6,7 @@ authors = ["Larry Smith Jr. <mrlesmithjr@gmail.com>"]
|
|||||||
|
|
||||||
[tool.poetry.dependencies]
|
[tool.poetry.dependencies]
|
||||||
python = "^3.10"
|
python = "^3.10"
|
||||||
ansible = "2.9.7"
|
ansible = "4.2.0"
|
||||||
|
|
||||||
[tool.poetry.dev-dependencies]
|
[tool.poetry.dev-dependencies]
|
||||||
bandit = "^1.7.1"
|
bandit = "^1.7.1"
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
|
ansible-core==2.11.6; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0"
|
||||||
ansible-lint==4.2.0; (python_version >= "2.7" and python_full_version < "3.0.0") or (python_full_version >= "3.5.0")
|
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")
|
ansible==4.2.0; (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"
|
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"
|
astroid==2.8.6; python_version >= "3.6" and python_version < "4.0"
|
||||||
autopep8==1.6.0
|
autopep8==1.6.0
|
||||||
@@ -32,7 +33,7 @@ filelock==3.4.0; python_version >= "3.6" and python_full_version < "3.0.0" or py
|
|||||||
flake8==4.0.1; python_version >= "3.6"
|
flake8==4.0.1; python_version >= "3.6"
|
||||||
ghp-import==2.0.2; python_version >= "3.6"
|
ghp-import==2.0.2; python_version >= "3.6"
|
||||||
gitdb==4.0.9; python_version >= "3.7"
|
gitdb==4.0.9; python_version >= "3.7"
|
||||||
gitpython==3.1.24; python_version >= "3.7"
|
gitpython==3.1.30; 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"
|
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"
|
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"
|
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"
|
||||||
@@ -45,7 +46,7 @@ keyring==21.8.0; python_version >= "3.6" and python_version < "4.0" and (python_
|
|||||||
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"
|
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"
|
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"
|
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"
|
markupsafe==2.0.1; python_version >= "3.6"
|
||||||
mccabe==0.6.1; python_version >= "3.6" and python_version < "4.0"
|
mccabe==0.6.1; python_version >= "3.6" and python_version < "4.0"
|
||||||
mergedeep==1.3.4; python_version >= "3.6"
|
mergedeep==1.3.4; python_version >= "3.6"
|
||||||
mkdocs==1.2.3; python_version >= "3.6"
|
mkdocs==1.2.3; python_version >= "3.6"
|
||||||
@@ -88,6 +89,7 @@ pyyaml==5.4.1; python_full_version >= "3.6.1" and python_version >= "3.6" and (p
|
|||||||
regex==2021.11.10; python_full_version >= "3.6.2"
|
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-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"
|
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"
|
||||||
|
resolvelib==0.5.5; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0"
|
||||||
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"
|
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"
|
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"
|
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"
|
||||||
|
|||||||
+5
-1
@@ -1,7 +1,11 @@
|
|||||||
ansible==2.9.7; (python_version >= "2.7" and python_full_version < "3.0.0") or (python_full_version >= "3.5.0")
|
ansible-core==2.11.6; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0"
|
||||||
|
ansible==4.2.0; (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"
|
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"
|
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"
|
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"
|
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"
|
||||||
|
packaging==20.9; 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"
|
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"
|
||||||
|
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"
|
||||||
pyyaml==5.4.1; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.6.0"
|
pyyaml==5.4.1; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.6.0"
|
||||||
|
resolvelib==0.5.5; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0"
|
||||||
|
|||||||
+34
-22
@@ -1,19 +1,15 @@
|
|||||||
---
|
---
|
||||||
- name: centos | installing lvm2
|
- name: centos | installing lvm2 and sg3_utils
|
||||||
package:
|
package:
|
||||||
name: lvm2
|
name:
|
||||||
|
- lvm2
|
||||||
|
- sg3_utils
|
||||||
state: present
|
state: present
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
- include_tasks: amazon.yml
|
- include_tasks: amazon.yml
|
||||||
when: ansible_facts.system_vendor == 'Amazon EC2'
|
when: ansible_facts.system_vendor == 'Amazon EC2'
|
||||||
|
|
||||||
- name: centos | installing sg3_utils
|
|
||||||
package:
|
|
||||||
name: sg3_utils
|
|
||||||
state: present
|
|
||||||
become: true
|
|
||||||
|
|
||||||
- name: centos | debug lvg
|
- name: centos | debug lvg
|
||||||
debug:
|
debug:
|
||||||
var: lv
|
var: lv
|
||||||
@@ -38,20 +34,36 @@
|
|||||||
- lv.1.create is defined
|
- lv.1.create is defined
|
||||||
- lv.1.create|bool
|
- lv.1.create|bool
|
||||||
|
|
||||||
- name: centos | checking for scsi devices
|
- name: centos | check for scsi adapters
|
||||||
command: sg_scan
|
find:
|
||||||
|
paths: "/sys/class/scsi_host"
|
||||||
|
file_type: any
|
||||||
become: true
|
become: true
|
||||||
register: scsi_devices
|
register: scsi_adapters
|
||||||
changed_when: false
|
|
||||||
|
|
||||||
- name: centos | rescanning for new disks
|
- block:
|
||||||
command: /usr/bin/rescan-scsi-bus.sh
|
- name: centos | installing sg3_utils
|
||||||
become: true
|
package:
|
||||||
changed_when: false
|
name: sg3_utils
|
||||||
when: scsi_devices.stdout|length > 0
|
state: present
|
||||||
|
become: true
|
||||||
|
|
||||||
- name: centos | rescanning for resized disks
|
- name: centos | checking for scsi devices
|
||||||
command: /usr/bin/rescan-scsi-bus.sh -s
|
command: sg_scan
|
||||||
become: true
|
become: true
|
||||||
changed_when: false
|
register: scsi_devices
|
||||||
when: scsi_devices.stdout|length > 0
|
changed_when: false
|
||||||
|
|
||||||
|
- name: centos | rescanning for new disks
|
||||||
|
command: "{{ rescan_scsi_command }}"
|
||||||
|
become: true
|
||||||
|
changed_when: false
|
||||||
|
when: scsi_devices.stdout|length > 0
|
||||||
|
|
||||||
|
- name: centos | rescanning for resized disks
|
||||||
|
command: "{{ rescan_scsi_command }} -s"
|
||||||
|
become: true
|
||||||
|
changed_when: false
|
||||||
|
when: scsi_devices.stdout|length > 0
|
||||||
|
|
||||||
|
when: scsi_adapters.matched > 0
|
||||||
|
|||||||
@@ -45,12 +45,14 @@
|
|||||||
- lv.create|bool
|
- lv.create|bool
|
||||||
- lv.filesystem is defined
|
- lv.filesystem is defined
|
||||||
- lv.filesystem != 'None'
|
- lv.filesystem != 'None'
|
||||||
|
- lv.filesystem != 'swap'
|
||||||
- lv.filesystem != 'xfs'
|
- lv.filesystem != 'xfs'
|
||||||
|
|
||||||
- name: create_fs | 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 }}"
|
||||||
|
opts: "{{ lv.fsopts | default(omit) }}"
|
||||||
become: true
|
become: true
|
||||||
when:
|
when:
|
||||||
- mountedxfs is failed
|
- mountedxfs is failed
|
||||||
|
|||||||
+1
-1
@@ -34,7 +34,7 @@
|
|||||||
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: "{{ rescan_scsi_command }}"
|
||||||
become: true
|
become: true
|
||||||
changed_when: false
|
changed_when: false
|
||||||
when: scsi_devices['stdout'] | length
|
when: scsi_devices['stdout'] | length
|
||||||
|
|||||||
@@ -1,5 +1,13 @@
|
|||||||
---
|
---
|
||||||
# tasks file for ansible-manage-lvm
|
# tasks file for ansible-manage-lvm
|
||||||
|
- name: Set rescan_scsi_command for old debian version
|
||||||
|
set_fact:
|
||||||
|
rescan_scsi_command: "/sbin/rescan-scsi-bus"
|
||||||
|
when:
|
||||||
|
- ansible_facts.distribution | replace(' ','') | lower == 'debian'
|
||||||
|
- ansible_facts.distribution_release not in ('bookworm', 'sid')
|
||||||
|
- ansible_facts.distribution_major_version is version(10, '<=')
|
||||||
|
|
||||||
- include_tasks: debian.yml
|
- include_tasks: debian.yml
|
||||||
when: ansible_facts.os_family == "Debian"
|
when: ansible_facts.os_family == "Debian"
|
||||||
|
|
||||||
|
|||||||
@@ -3,3 +3,5 @@
|
|||||||
|
|
||||||
ebsnvme_binary_helper_file: go-ebsnvme_{{ ebsnvme_binary_helper_ver }}_linux_amd64.tar.gz
|
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 }}
|
ebsnvme_binary_helper_url: https://github.com/mvisonneau/go-ebsnvme/releases/download/{{ ebsnvme_binary_helper_ver }}/{{ ebsnvme_binary_helper_file }}
|
||||||
|
|
||||||
|
rescan_scsi_command: "/usr/bin/rescan-scsi-bus.sh"
|
||||||
|
|||||||
Reference in New Issue
Block a user