-
Notifications
You must be signed in to change notification settings - Fork 45
[Module][1717]new_module_zfs_resize #1767
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
170 commits
Select commit
Hold shift + click to select a range
3fb4313
Remove Hardcoded hlq
AndreMarcel99 ccff1e4
Fix removal
AndreMarcel99 4f6b373
Add some solution
AndreMarcel99 6196bfc
First version module
AndreMarcel99 6fc41a9
Get size correctly
AndreMarcel99 5f6cf47
Refactor module and add new module_utils
AndreMarcel99 dfdf365
Add comments
AndreMarcel99 b8419e9
Fix documentation
AndreMarcel99 66aeda3
Less code, working with verbose
AndreMarcel99 21f0e18
Merge branch 'dev' into module/1717/support_resizing
AndreMarcel99 4de7ecb
Fix comments
AndreMarcel99 17340a1
Merge branch 'dev' into module/1717/support_resizing
AndreMarcel99 bf2de90
Fix comments and verbose
AndreMarcel99 33d4c20
Fix comments
AndreMarcel99 6768c7d
Fix documentation
AndreMarcel99 ae27c9b
Merge branch 'dev' into module/1717/support_resizing
AndreMarcel99 7fc4db7
Fix trc and cyl
AndreMarcel99 6633968
Generate file
AndreMarcel99 ed76588
Merge branch 'dev' into module/1717/support_resizing
AndreMarcel99 7a25660
Fix names and operations
AndreMarcel99 7af7546
Update plugins/modules/zos_zfs_resize.py
AndreMarcel99 6ac622d
Update plugins/modules/zos_zfs_resize.py
AndreMarcel99 68c5d7f
hange to space_type
AndreMarcel99 1d96e32
Update plugins/modules/zos_zfs_resize.py
AndreMarcel99 646743d
Update plugins/modules/zos_zfs_resize.py
AndreMarcel99 e3a1e5d
Update plugins/modules/zos_zfs_resize.py
AndreMarcel99 575b7e3
Update plugins/modules/zos_zfs_resize.py
AndreMarcel99 7e72ac5
Change names
AndreMarcel99 c4f7712
Add comments
AndreMarcel99 da4da68
Return size of space_type given by the user
AndreMarcel99 41bc999
Add obj as name
AndreMarcel99 4158d40
Add first two basic test cases
AndreMarcel99 88287a2
Fix documentation
AndreMarcel99 6654573
Fix documentation
AndreMarcel99 67c9136
Merge branch 'dev' into module/1717/support_resizing
AndreMarcel99 f752b40
Fix documentation
AndreMarcel99 465a412
Fix documentation
AndreMarcel99 a52e51b
Fix comments and add trace_path
AndreMarcel99 c50f474
Fix verbose
AndreMarcel99 469924d
Add validation to full traceback
AndreMarcel99 e44a31d
Merge branch 'dev' into module/1717/support_resizing
AndreMarcel99 4363173
Fix error message
AndreMarcel99 98f33be
Add fix type
AndreMarcel99 4e1b9b3
Add test case
AndreMarcel99 9be927a
Remove cp
AndreMarcel99 164a996
Fix dir_path
AndreMarcel99 0d48999
Add fragment
AndreMarcel99 216b104
Fix tracks and cylinder
AndreMarcel99 f6bb368
Add test case of space_type
AndreMarcel99 3aecd01
Add test cases for all positives cases
AndreMarcel99 95f5948
Update Github bug and enhancement templates with latest versions (#1820)
fernandofloresg 2aef1b3
Merge branch 'dev' into enabler/1652/migrate_shell_call_cp_to_python_…
AndreMarcel99 776a66d
Update plugins/modules/zos_fetch.py
AndreMarcel99 9f2053c
Update plugins/modules/zos_fetch.py
AndreMarcel99 f8d5255
Update plugins/modules/zos_fetch.py
AndreMarcel99 cfcfc36
Fix execpton handle
AndreMarcel99 5da0601
Fix sanity
AndreMarcel99 9f04361
Adjust best practices
AndreMarcel99 4e444c6
Merge branch 'dev' into enabler/1589/volume_init_portability
AndreMarcel99 8cd43df
Add negative correct error
AndreMarcel99 04fcf3c
Fix sanity
AndreMarcel99 b559aab
Use raises
AndreMarcel99 ad8989e
Merge branch 'dev' into module/1717/support_resizing
AndreMarcel99 04c3770
Merge pull request #1816 from ansible-collections/enabler/1652/migrat…
AndreMarcel99 cb6d498
Update mounts.env (#1826)
richp405 1c64254
[zos_mvs_raw] Find VSAM cluster when DISP=OLD and find data and index…
fernandofloresg fec1e17
Fix error messages and more
AndreMarcel99 c732781
Fix test cases issues positives and add negatives
AndreMarcel99 414613b
Merge branch 'dev' into module/1717/support_resizing
AndreMarcel99 28d12b0
Fix resize call
AndreMarcel99 b79ce3d
Merge branch 'dev' into enabler/1589/volume_init_portability
AndreMarcel99 7a420e8
End portability
AndreMarcel99 3b813bc
Add fragment
AndreMarcel99 67ff6f4
[enabler][zos_copy]Add_error_message (#1821)
AndreMarcel99 8fcb91c
Merge branch 'dev' into module/1717/support_resizing
AndreMarcel99 b10cea5
Get aggregation size available for everyone
AndreMarcel99 e40ccfb
Merge branch 'dev' into enabler/1589/volume_init_portability
AndreMarcel99 6a39b13
Fix no change on type
AndreMarcel99 d8faad9
Merge pull request #1830 from ansible-collections/enabler/1589/volume…
AndreMarcel99 9a49878
Add validation
AndreMarcel99 cd5fc23
Add extra asserts
AndreMarcel99 efe9bbd
Enhance error message
AndreMarcel99 5b56fc5
Add space
AndreMarcel99 742ebff
Updates to release notes and support for ansible-core 2.18 venv for A…
ddimatos 3db400b
[Enabler] [AC tool] Add more options when testing with the AC tool (#…
rexemin 1e7c6d4
Fix trace dataset
AndreMarcel99 6b209fb
Add trace
AndreMarcel99 06d659a
Merge branch 'dev' into module/1717/support_resizing
AndreMarcel99 d033d4d
Add space
AndreMarcel99 816167c
[Enabler] [module_utils/copy.py] Replace calls to cp for dcp's Python…
rexemin 11a5075
Add test cases
AndreMarcel99 3263091
Merge branch 'dev' into module/1717/support_resizing
AndreMarcel99 58029a8
Add test case to validate test lineinfile
AndreMarcel99 e70cc1a
Add fragment
AndreMarcel99 2281ba7
Update tests/functional/modules/test_zos_lineinfile_func.py
AndreMarcel99 ff83a37
Update changelogs/fragments/1842-Add_test_case_to_validate_advance_re…
AndreMarcel99 9523b47
Update test_zos_lineinfile_func.py
AndreMarcel99 5aa6c8d
Validate use of members
AndreMarcel99 573dd9a
Add pds pdse and member fails
AndreMarcel99 fad3ff4
Merge branch 'dev' into module/1717/support_resizing
AndreMarcel99 afe4f96
Fix sanity issues
AndreMarcel99 a62da4e
Fix error message and space_Type in lower case
AndreMarcel99 22c5927
Change names
AndreMarcel99 892325f
Add docstring
AndreMarcel99 3f23af5
Add documentation
AndreMarcel99 d20eed3
fix upper case
AndreMarcel99 3549fe8
Add comments
AndreMarcel99 f87e63d
Add ignore
AndreMarcel99 61a7957
Add documentation
AndreMarcel99 0f9a369
Try to fix the lint
AndreMarcel99 954f0ef
Final test case
AndreMarcel99 f2e833e
Fix two runs
AndreMarcel99 d536858
Delete uneccesary validation
AndreMarcel99 aa84dfb
Fix test case and add to github templates
AndreMarcel99 adf836c
Fix error return message
AndreMarcel99 1d5f2e5
Add test case
AndreMarcel99 1d0101a
Return functions
AndreMarcel99 1b9d0bd
Add member
AndreMarcel99 45554ec
Add test case
AndreMarcel99 d0f4649
Add test case
AndreMarcel99 ffca232
Add missing import
AndreMarcel99 425e360
Add missing import
AndreMarcel99 514e00c
Add documentation
AndreMarcel99 91ae341
Fix playbook
AndreMarcel99 d071c04
Fix error test case
AndreMarcel99 c1c3298
Merge branch 'dev' into module/1717/support_resizing
AndreMarcel99 1212543
Fix version of inventory
AndreMarcel99 9819598
Remove repeitive test case
AndreMarcel99 6982b35
Update plugins/module_utils/zfsadm.py
AndreMarcel99 5df8218
Add validation to avoid no auto increment
AndreMarcel99 6f3d5d3
Fix a comment
AndreMarcel99 853c1ff
Fix documentation
AndreMarcel99 af6eb51
Apply suggestions from code review
AndreMarcel99 99f5aa5
Add notes
AndreMarcel99 13b7eae
Scape points
AndreMarcel99 a365705
Scape points
AndreMarcel99 c86b421
Scape points
AndreMarcel99 b20425b
Merge branch 'dev' into module/1717/support_resizing
AndreMarcel99 edf8a8a
Update plugins/modules/zos_zfs_resize.py
AndreMarcel99 9ecdc92
Update plugins/modules/zos_zfs_resize.py
AndreMarcel99 d6c912d
Add 2025 and adjust to comments
AndreMarcel99 417bb96
Add notes
AndreMarcel99 bd9100e
Fix errors
AndreMarcel99 d7e9290
Fix documentation problem
AndreMarcel99 51a9982
Fix comment and test case
AndreMarcel99 9fcba89
Fix comment
AndreMarcel99 c559616
Fix comment
AndreMarcel99 a275529
Fix comment
AndreMarcel99 6dd9e90
Fix error when creating one
AndreMarcel99 7430c50
Fix error when creating one
AndreMarcel99 e15e259
Fix error messaging
AndreMarcel99 4cf6cd7
Fix documentation
AndreMarcel99 6fa1544
Fix output
AndreMarcel99 fbf455c
Add extra validations
AndreMarcel99 4e17e0c
Fix resize
AndreMarcel99 e3364a9
Ensure proper size creation
AndreMarcel99 978e780
Fix eror assertion
AndreMarcel99 6c418a4
Add documenation and full verification
AndreMarcel99 0111b12
Merge branch 'dev' into module/1717/support_resizing
AndreMarcel99 4fb3874
Fix PDS and PDSE
AndreMarcel99 095ee97
Fix documentation
AndreMarcel99 9a17f73
Fix validation
AndreMarcel99 0e61364
Fix documentation and stderr for SEQ dataset
AndreMarcel99 be63f6c
Update documentation
AndreMarcel99 c927b3c
Fix names
AndreMarcel99 19d812f
Fix lint
AndreMarcel99 f2beb84
Update word increment to increase
ddimatos 11af40c
Fix all type of names for uss trace destination
AndreMarcel99 169ab99
Check trace uss on other size
AndreMarcel99 71c3d9d
Merge branch 'dev' into module/1717/support_resizing
AndreMarcel99 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -146,5 +146,6 @@ body: | |
- zos_tso_command | ||
- zos_unarchive | ||
- zos_volume_init | ||
- zos_zfs_resize | ||
validations: | ||
required: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,5 +83,6 @@ body: | |
- zos_tso_command | ||
- zos_unarchive | ||
- zos_volume_init | ||
- zos_zfs_resize | ||
validations: | ||
required: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,6 +53,7 @@ body: | |
- zos_tso_command | ||
- zos_unarchive | ||
- zos_volume_init | ||
- zos_zfs_resize | ||
validations: | ||
required: false | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,6 +51,7 @@ body: | |
- zos_tso_command | ||
- zos_unarchive | ||
- zos_volume_init | ||
- zos_zfs_resize | ||
validations: | ||
required: true | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# Copyright (c) IBM Corporation 2025 | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
from __future__ import absolute_import, division, print_function | ||
__metaclass__ = type | ||
|
||
|
||
class zfsadm: | ||
"""Provides an interface to execute zfsadm commands. | ||
""" | ||
def __init__(self, aggregate_name, module): | ||
"""Initialize a class with its zfs dataset and allow modules to be executed. | ||
Parameters | ||
---------- | ||
aggregate_name : str | ||
Name of the zfs dataset. | ||
module : object | ||
Ansible object to execute commands. | ||
""" | ||
self.aggregate_name = aggregate_name.upper() | ||
self.module = module | ||
|
||
def execute_resizing(self, operation, size, noai, verbose): | ||
"""Execute a grow or shrink operation on a zfs dataset. | ||
|
||
Parameters | ||
---------- | ||
operation : str | ||
Whether the operation to execute is grow or shrink | ||
size : int | ||
Size to be assigned to the zfs | ||
noai : str | ||
Value for the no auto increase (noai) option when shrinking a dataset | ||
verbose : str | ||
Value for zfsadm's trace option specifying the output file for the command | ||
|
||
Returns | ||
------- | ||
rc : int | ||
The RC of the command executed. | ||
stdout : str | ||
The stdout of the executed command. | ||
stderr : str | ||
The stderr of the executed command. | ||
cmd_str : str | ||
The full command that was executed. | ||
""" | ||
if operation != "grow": | ||
if operation != "shrink": | ||
self.module.fail_json(msg=f"There is no operator {operation}") | ||
|
||
cmd = f"-size {size}{noai}{verbose}" | ||
cmd_str = f"zfsadm {operation} -aggregate {self.aggregate_name} {cmd}" | ||
|
||
rc, stdout, stderr = self.module.run_command(cmd_str) | ||
|
||
return rc, stdout, stderr, cmd_str | ||
|
||
@staticmethod | ||
def get_aggregate_size(aggregate_name, module): | ||
"""Execute a command to get the size of a zfs dataset. | ||
|
||
Returns | ||
------- | ||
rc : int | ||
The rc of the executed command. | ||
stdout : str | ||
The stdout of the executed command | ||
stderr : str | ||
The stderr of the executed command. | ||
""" | ||
cmd = f"zfsadm aggrinfo {aggregate_name}" | ||
|
||
rc, stdout, stderr = module.run_command(cmd) | ||
|
||
return rc, stdout, stderr |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.