Input on module to resize filesystems.

128 views
Skip to first unread message

C. Morgan Hamill

unread,
Jul 15, 2014, 8:25:27 AM7/15/14
to ansible-project
I have need of this.

Should I add this ability to the existing `filesystem` module, or do
folks think it ought to be a separate module?
--
Morgan

Michael DeHaan

unread,
Jul 15, 2014, 11:37:37 AM7/15/14
to ansible...@googlegroups.com
Can you share more about what the proposed syntax might be for this flag (such as an example playbook line?)





--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/1405427075-sup-7592%40al.wesleyan.edu.
For more options, visit https://groups.google.com/d/optout.

C. Morgan Hamill

unread,
Jul 15, 2014, 1:16:14 PM7/15/14
to ansible-project
Excerpts from Michael DeHaan's message of 2014-07-15 11:37:33 -0400:
> Can you share more about what the proposed syntax might be for this flag
> (such as an example playbook line?)

That's actually where I run into trouble; the filesystem module's
arguments and their semantics don't leave a lot of room for extending.

Currently, the filesystem module will create a filesystem if none
exists, or create filesystem unconditionally when force=yes.

I could imagine changing the behavior by adding a 'size' parameter, so
that one could do the following:

---
# creates a filesystem or resizes the filesystem to fit its block device
filesystem: dev=/dev/sda1 fstype=ext4

# creates a filesystem of a given size or expands an existing filesystem to 10g
filesystem: dev=/dev/sda1 fstype=ext4 size=10g

# creates a filesystem of a given size, or expands or *shrinks* as necessary
filesystem: dev=/dev/sda1 fstype=ext4 size=10g allow_shrinking=yes

# creates a filesystem unconditionally
filesystem: dev=/dev/sda1 fstype=ext4 size=10g force=yes

This has the disadvantage of being kind of magic, and changing the
module's current behavior when passed only 'dev' and 'fstype' (currently
it leaves the filesystem untouched).

Other alternatives might be adding a 'allow_resizing' parameter that
defaulted to false and preserved the modules current behavior, making
resizing opt-in.

One could also imagine a 'state' parameter which took 'present' and
'absent' in addition to something like 'sized', where only the latter
triggers resizing.

Obviously there will be sanity checks to avoid loss of data via
shrinking, for example.

Not sure about the best approach here.
--
Morgan Hamill

Michael DeHaan

unread,
Jul 16, 2014, 5:01:33 PM7/16/14
to ansible...@googlegroups.com
I think I might favor resize=yes|no default no.




--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages