new module: Configure LVM and NFS file systems for AIX#30810
new module: Configure LVM and NFS file systems for AIX#30810dagwieers merged 11 commits intoansible:develfrom
Conversation
This module creates, removes, mount and unmount LVM and NFS file system for AIX using /etc/filesystems. For LVM file systems is also possible to resize the file system.
better parameters options structure
Added better tratment for return codes for file system resize. When a resize is not possible because no enough space on lv or shrink is not allowed.
- improved doc - creation file system return code 10 was treated.
|
@AugustusKling @ColOfAbRiX @DavidWittman @EvanK @LinusU @abulimov @adejoux @agaffney @ahtik @Akasurde @azaghal @dankeder @davixx @dougluce @dsummersl @giovannisciortino @goozbach @groks @haad @hryamzik @jasperla @jhoekx @jsumners @jtyr @kevensen @lberruti @matze @maxamillion @mcv21 @molekuul @mpdehaan @mulby @natefoo @nibalizer @ovcharenko @pmarkham @pyykkis @risaacson @rosmo @saito-hideki @sfromm @srvg @tdtrask @tmshn @xen0l As a maintainer of a module in the same namespace this new module has been submitted to, your vote counts for shipits. Please review this module and add |
dagwieers
left a comment
There was a problem hiding this comment.
So looking at the code, I think the main part could use a generic result dictionary that is modified as you go.
result = dict(
changed=False
)And then you can set it to changed whenever there's a change induced.
result['changed'] = True
result['msg'] = 'Foo bar'And when you call fail_json() or exit_json() you can simply provide it the dictionary:
if something:
fail_json(**result)
exit_json(**result)This ensures that if you make a change, but it fails subsequently, you return the change-flag on failure as well.
|
It would probably be best to also include integration tests. Not that they will be run as part of Shippable (as we don't have AIX targets), but it is useful for contributors (and maintainers) to test if the module still works as expected. (And you already have these tests) |
|
Hi @dagwieers I'm blocked with integration tests. Should I write Write the integration tests is ok, but how can I run this tests by myself? I would like run the test in my environment. Thanks in advance to help me with that. [1] ansible-test -h
usage: ansible-test [-h] COMMAND ...
positional arguments:
COMMAND
integration posix integration tests
network-integration
network integration tests
windows-integration
windows integration tests
aix-integration aix integration tests
units unit tests
compile compile tests
sanity sanity tests
shell open an interactive shell
coverage code coverage management and reporting
optional arguments:
-h, --help show this help message and exit
ansible-test aix-integration --aix test/integration/inventory.aixremote.template aix_filesystem
Traceback (most recent call last):
File "/Users/kairo/Dev/Ansible/aix_integration/ansible/test/runner/ansible-test", line 696, in <module>
main()
File "/Users/kairo/Dev/Ansible/aix_integration/ansible/test/runner/ansible-test", line 92, in main
args.func(config)
File "/Users/kairo/Dev/Ansible/aix_integration/ansible/test/runner/lib/executor.py", line 403, in command_aix_integration
remotes = [instance.wait_for_result() for instance in instances]
File "/Users/kairo/Dev/Ansible/aix_integration/ansible/test/runner/lib/thread.py", line 48, in wait_for_result
exec('raise exception[0], exception[1], exception[2]') # pylint: disable=locally-disabled, exec-used
File "/Users/kairo/Dev/Ansible/aix_integration/ansible/test/runner/lib/thread.py", line 34, in run
self._result.put((self.action(), None))
File "/Users/kairo/Dev/Ansible/aix_integration/ansible/test/runner/lib/executor.py", line 427, in aix_run
core_ci.start()
File "/Users/kairo/Dev/Ansible/aix_integration/ansible/test/runner/lib/core_ci.py", line 149, in start
return self.start_remote()
File "/Users/kairo/Dev/Ansible/aix_integration/ansible/test/runner/lib/core_ci.py", line 153, in start_remote
with open(self.ci_key, 'r') as key_fd:
IOError: [Errno 2] No such file or directory: '/Users/kairo/.ansible-core-ci.key' |
- Added doc recomendations - Changed return to dict results on main() - Using 159 columns for code limit
Fixed wrong changed return when file system is already mounted. When the file system is already mounted the return for changed is False.
- Fixed description - Included playbook for manual tests
|
@mattclay What needs to be done here to get this merged? |
dagwieers
left a comment
There was a problem hiding this comment.
LGTM, although there are still a few review items open.
Then we can merge this.
…_filesystem/tasks/main.yml Move integration test to its proper location
dagwieers
left a comment
There was a problem hiding this comment.
LGTM, waiting for CI to succeed.
* new module: AIX LVM file system and NFS This module creates, removes, mount and unmount LVM and NFS file system for AIX using /etc/filesystems. For LVM file systems is also possible to resize the file system. * better parameters options structure better parameters options structure * Improved file system resize returns Added better tratment for return codes for file system resize. When a resize is not possible because no enough space on lv or shrink is not allowed. * improved doc and creation file system return code - improved doc - creation file system return code 10 was treated. * Doc recomendations, dict result, line limit - Added doc recomendations - Changed return to dict results on main() - Using 159 columns for code limit * wrong changed return when file system is already Fixed wrong changed return when file system is already mounted. When the file system is already mounted the return for changed is False. * Fixed description and included playbook for tests - Fixed description - Included playbook for manual tests * Various small bits to get this merged ASAP * Rename test/legacy/aix_filesystem.yml to test/integration/targets/aix_filesystem/tasks/main.yml Move integration test to its proper location * Create aliases * Fix CI issues
SUMMARY
This module creates, removes, mount and unmount LVM and NFS file system for AIX using
/etc/filesystems. For LVM file systems is possible to resize a file system.ISSUE TYPE
COMPONENT NAME
aix_filesystem
ANSIBLE VERSION
ADDITIONAL INFORMATION
Functional tests.
aix_fs.yml
output