Comments (13)
Here is a patch that removes --force by default and let the user specify it via lvreduce_options (would need update in the lvol documentation too):
root ~ # diff /usr/lib/python2.7/site-packages/ansible/modules/extras/system/lvol.py.orig /usr/lib/python2.7/site-packages/ansible/modules/extras/system/lvol.py
43a44,55
> lvreduce_options:
> description:
> - Additional options to pass to C(lvreduce) when reducing the volume group.
> default: null
> required: false
> version_added: "1.8.2"
> lvextend_options:
> description:
> - Additional options to pass to C(lvextend) when expanding the volume group.
> default: null
> required: false
> version_added: "1.8.2"
97d108
<
103a115,116
> lvreduce_options=dict(default=''),
> lvextend_options=dict(default=''),
112a126,127
> lvreduceoptions = module.params['lvreduce_options'].split()
> lvextendoptions = module.params['lvextend_options'].split()
212c227
< tool = 'lvextend'
---
> tool = 'lvextend ' + ' '.join(lvextendoptions)
214,216c229
< if not force:
< module.fail_json(msg="Sorry, no shrinking of %s without force=yes." % (this_lv['name']))
< tool = 'lvreduce --force'
---
> tool = 'lvreduce ' + ' '.join(lvreduceoptions)
root ~ #
tested here with:
ansible -i hosts vsrv1942.int.belbone.be -m lvol -a "vg=system lv=pkg state=present size=2G lvreduce_options='--resizefs --force' lvextend_options='--resizefs --force'" -vvv
I didn't push a merge request because I don't expect you merge the code as-is, but rather it's to provide you guys visibility on the issue and how we worked around it.
The only downside of using --resizefs is that if the volume is mounted it needs to be unmounted prior to running:
lvreduce -y --resizefs --force -L 1G system/pkg
since --resizefs will show a question ('Do you want to unmount "/pkg"? [Y|n]') that needs manual input.
Maybe an additional option (umount=yes only required when passing --resizefs) that would input 'Y'.
But then I guess it would make better sense to have resizefs=yes option instead of what I've proposed above.
So ideally I could see something like:
ansible -i hosts vsrv1942.int.belbone.be -m lvol -a "vg=system lv=pkg state=present size=2G force=yes resizefs=yes umount=yes" -vvv
That would result in a case of lvreduce:
- umounting (umount=yes would provide the 'Y' input - shame lvreduce/lvextend requries manual input)
- resize the FS
- resize the LV
Same for lvextend but in the other way:
- umount
- resize the LV
- resize the FS
Let me know your thoughts and/or if you need some support to test in a hummm prod env :)
thanks for the good work
from ansible-modules-extras.
[module: system/lvol.py]
from ansible-modules-extras.
@r1k0 Thanks for submitting this feature idea. Sorry it's taken us a while to triage it. :)
@jhoekx & @abulimov Pinging you to bring this feature request for your attention. Please note that you are under no particular obligation to add this feature.
We encourage all Ansible community members to submit pull requests to satisfy feature requests. Consult the module guidelines (http://docs.ansible.com/ansible/developing_modules.html) for more information.
from ansible-modules-extras.
@robynbergeron Looks like its been about 3 months since you asked the authors for review, what do we do when the authors do not respond?
from ansible-modules-extras.
Sorry, missed previous notification. As lvol module now supports opts argument, I think it would be far better to just pass opts not only for lvcreate, but for lvreduce/lvextend commands too. Implementing this looks trivial.
from ansible-modules-extras.
@jhoekx, @abulimov, ping. This issue is still waiting on your response.
click here for bot help
from ansible-modules-extras.
@jhoekx, @abulimov, ping. This issue is still waiting on your response.
click here for bot help
from ansible-modules-extras.
@jhoekx, @abulimov, ping. This issue is still waiting on your response.
click here for bot help
from ansible-modules-extras.
@jhoekx, @abulimov, ping. This issue is still waiting on your response.
click here for bot help
from ansible-modules-extras.
This repository has been locked. All new issues and pullrequests should be filed in https://github.com/ansible/ansible
Please read through the repomerge page in the dev guide. The guide contains links to tools which automatically move your issue or pullrequest to the ansible/ansible repo.
from ansible-modules-extras.
This issue was migrated to ansible/ansible#29194
from ansible-modules-extras.
lvol module doesn't take options for lvextend by default and ignored the previous 2GB filesystems.
- name: lv extend and resize
lvol:
vg: "{{ item.0.vgname }}"
lv: "{{ item.1.lvname }}"
size: "{{ item.1.size }}"
shrink: no
with_subelements:
- "{{ lvm_groups_extend }}"
- lvnames
Initial File System size is 2GB
then I am trying to expand to 12GB (10GB more) but its showing 10GB only. Do you have any idea? if fix will delay, then I may need to go for shell option.
from ansible-modules-extras.
@karthi81 This repo is closed. Please open new issue here.
from ansible-modules-extras.
Related Issues (20)
- win_updates Not working on localized Windows Server 2012R2 (russian) HOT 3
- Pushover Hostname api.pushover.net:443 doesn't match HOT 2
- ipa_user: fails with 'repsonse user_mod: no modifications to be performed' if sshpubkey is an empty list and user has no public keys in FreeIPA HOT 2
- ovirt_clusters fails with 'NoneType' object has no attribute 'policy' HOT 2
- locale_gen fails with python3 HOT 1
- Region eu-west-2 missing on ansible-2.2 ec2 module HOT 1
- kubernetes library module doesn't support `apis/extensions/v1beta1/` HOT 2
- customer GW module HOT 1
- composer: Unable to use "working-dir" with spaces HOT 1
- Add instance_type to ec2_remote_facts result HOT 1
- v HOT 1
- openvswitch_bridge ansible 2.3.0 HOT 1
- win_regedit - Not adding new reg entries HOT 1
- EFS Name is blank when created with ansible efs module HOT 1
- pexpect 4.0.1 Ansible variable issue HOT 1
- module vmware_vm_facts folder HOT 1
- installing npm mongodb error HOT 3
- Ovirt_vms module to support custom VM UUID HOT 1
- vmware vsphere_guest with drs HOT 1
- Getting "HTTP Error 504": HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-modules-extras.