mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-20 11:04:00 -07:00
New module zpool (#10146)
* Add zpool module * Add botmeta * Use str.format instead of f-strings * Remove nonlocal usage * Add check to only pass ashift to zpool add * Extend ansible_spec and remove unnecessary validation * Apply suggestions and fix style * Fix indentation of yaml lists * Add method to normalize vdevs Fix role: none in vdevs * Use CmdRunner instead of run_command * Fix styling and documentation * Use str.format instead of f-strings * Make sure vdevs are only required when state is present * Add support for loop devices and normalize vdev type * Add integration tests * Add missing test dependencies for alpine and redhat * Skip integration tests on rhel10 until there there packages available * Use package module for better auto detection of package manager on rhel * Add copyright header * Skip tests on rhel and remove redhat install requirements * Ensure loop devices under /dev exist * Enable usage of files as pool devices * Remove disk setup * Use files as disks * Apply suggestions * Fix argument_spec
This commit is contained in:
parent
8bd68e7e41
commit
928622703d
11 changed files with 1064 additions and 0 deletions
25
tests/integration/targets/zpool/tasks/main.yml
Normal file
25
tests/integration/targets/zpool/tasks/main.yml
Normal file
|
@ -0,0 +1,25 @@
|
|||
---
|
||||
# Copyright (c) 2025, Tom Hesse <contact@tomhesse.xyz>
|
||||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
- name: Execute integration tests
|
||||
become: true
|
||||
block:
|
||||
- name: Ensure disk files exists
|
||||
ansible.builtin.command:
|
||||
cmd: "dd if=/dev/zero of={{ item }} bs=1M count=256 conv=fsync"
|
||||
creates: "{{ item }}"
|
||||
loop: "{{ zpool_disk_configs }}"
|
||||
|
||||
- name: Include distribution specific install_requirements.yml
|
||||
ansible.builtin.include_tasks: install_requirements_{{ ansible_distribution | lower }}.yml
|
||||
|
||||
- name: Include create_destroy.yml
|
||||
ansible.builtin.include_tasks: create_destroy.yml
|
||||
|
||||
- name: Include add_remove_vdevs.yml
|
||||
ansible.builtin.include_tasks: add_remove_vdevs.yml
|
||||
|
||||
- name: Include properties.yml
|
||||
ansible.builtin.include_tasks: properties.yml
|
Loading…
Add table
Add a link
Reference in a new issue