Commit graph

42 commits

Author SHA1 Message Date
Yves MOYROUD
59fef9a11f
Merge d05a5c70b5 into 6da1331018 2025-08-18 12:31:49 +00:00
Felix Fontein
ab8dfefd90 Use module.warn() instead of returning warnings. 2025-08-06 06:49:32 +02:00
Vladimir Botka
8e34860d6c
Fix #595. Remove comment from fstab entry on updating. 2024-11-21 20:54:27 +01:00
Yves MOYROUD
572167b9c1
Update mount.py
deleted trailing newlines
2024-10-11 17:10:24 +02:00
Yves MOYROUD
841a0f3314
modules/mount.py 2024-10-11 16:46:26 +02:00
Yves MOYROUD
5bc6f636f7
Update mount.py
still a trailing whitespace
2024-10-04 09:08:03 +02:00
copyrights
2041e7f918
mount: remove boot exception if defaults in opts 2024-10-04 14:39:04 +09:00
Yves MOYROUD
284025660c
delete trailing spaces in mount.py
delete trailing spaces in comments in mount.py
2024-10-03 17:27:18 +02:00
Yves MOYROUD
f7f54f242d
Update mount.py
suppressed erroneous remaining TOTO check
2024-10-03 13:32:42 +02:00
Yves MOYROUD
966df79767
Update mount.py
new option keep_mountpoint enables keeping the mountpoint with state=absent
2024-10-03 11:36:45 +02:00
Yves MOYROUD
5ee818ec86
Update mount.py
In function main(), remove rmdir in case if state == 'absent'.
Unmounting a file system should not lead to delete anything that is revealed after unmounting. 
Also, it leads to an error if a non empty directory is present under the ex-mountpoint after umount : [Errno 39] Directory not empty
So umount is successfull but the ansible run is failed. Of course, it is solved on second run.
2024-09-18 17:41:21 +02:00
Hideki Saito
e05b8507a4
Remove wrong version_added section from mount module
Signed-off-by: Hideki Saito <saito@fgrep.org>
2024-09-13 15:15:04 +09:00
dvillafana
e00a4299c1
(feat) add no_log options for 'opts' parameter
* Fixed #497
2024-09-11 11:04:16 +09:00
Alexei Znamensky
ef07eb8a06 Apply suggestions from code review
Thanks felixfontein for the thorough review. :-)

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-06-15 17:00:54 +12:00
Alexei Znamensky
0c9ab06a55 review modules docs 2024-06-15 17:00:54 +12:00
Adam Miller
a18d180246
Merge branch 'main' into fix/doc/mount_absent_description 2024-02-06 09:29:55 -06:00
Christer Warén
2a1fb334ee
mount: edit boot parameters warning condition (#523)
the CI failures are unrelated and shouldn't even be showing up ... I'm going to sort that out separately but that doesn't need to prevent this merge, all relevant CI tests passed
2024-01-09 16:06:26 -06:00
softwarefactory-project-zuul[bot]
a2ab6881db
Merge pull request #400 from vladislav-sharapov/fix-doc-boolean-values
Fix boolean values in docs

SUMMARY
Fixes #397
ISSUE TYPE

Docs Pull Request

COMPONENT NAME
Docs of several modules
ADDITIONAL INFORMATION
Notes about testing. I'm not sure how to test collections properly. I have ran ansible-test sanity --python 3.10 and ansible-test units --python 3.10 in venv with ansible-core 2.14 (with 0 return code in both cases). To run units test successfully I had to install pytest-forked pip package in addition to this one pytest-xdist from test-requirements.txt.
Note about issue #397. I haven't changed yes here because in this case it is value from /etc/vfstab. Also I've changed yes for parameters masquerade and icmp_block_inversion because they both are converted to bool by boolean function and will be changed to boolean in a future release (1, 2), for required too.

Reviewed-by: Felix Fontein <felix@fontein.de>
Reviewed-by: Hideki Saito <saito@fgrep.org>
2022-12-22 08:00:13 +00:00
Hideki Saito
bd9aa64a2b
Merge branch 'main' into ephemeral_state 2022-12-15 15:04:28 +09:00
softwarefactory-project-zuul[bot]
6b7dc6ee0a
Merge pull request #166 from dkjii-g/main
ansible.posix.mount: add absent_from_fstab option

SUMMARY
Add absent_from_fstab option to remove the entry from fstab, but not unmount or delete the folder. Ideally this would have been the behavior of absent (as to mirror the behavior of present), but for backward compatibility I added a new verbose state
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
mount
ADDITIONAL INFORMATION
Sometimes you may not want to delete the mountpoint (e.g. if it is not currently mounted and data is in the directory, the current behavior will simply error).

Reviewed-by: Amin Vakil <None>
Reviewed-by: None <None>
2022-12-15 03:00:24 +00:00
Vladislav Sharapov
d0e1504f8a Fix boolean values in docs 2022-12-09 00:36:29 +04:00
Hideki Saito
abfe36c62f Fix to follow pylint check in ansible-test-sanity-docker-devel
Signed-off-by: Hideki Saito <saito@fgrep.org>
2022-09-12 10:30:01 +09:00
NeodymiumFerBore
b8ed919011 Apply suggestions from code review
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2022-06-03 17:41:11 +02:00
NdFeB
04089e80fb Add ephemeral state to mount fs without altering fstab 2022-06-03 08:46:21 +02:00
Hideki Saito
0e71c0e530 Fixed documentation and options to address new sanity tests
- https://docs.ansible.com/ansible/latest/dev_guide/testing_validate-modules.html

Signed-off-by: Hideki Saito <saito@fgrep.org>
2022-04-01 13:23:45 +09:00
NdFeB
211e6c74b5 Fix absent state documentation 2022-03-12 15:25:38 +01:00
Tim Herren
40a9ff36bb Remove deprecated option from nfs mount example 2021-11-08 16:14:01 +01:00
Hideki Saito
5a2b3662cb mount - add a newline at the end of line in fstab
* Fixes #210

Signed-off-by: Hideki Saito <saito@fgrep.org>
2021-09-27 12:19:06 +09:00
Mandar Kulkarni
b740bdaf3a Merge https://github.com/ansible-collections/ansible.posix into issues/126/mount-return-backup-file 2021-06-30 04:11:28 -04:00
Hideki Saito
c29bbd265b Modify boot option handling on BSD systems
* Fixes #28 for BSD systems
* Porting PR #196 to BSD systems

Signed-off-by: Hideki Saito <saito@fgrep.org>
2021-06-08 20:44:42 +09:00
Adam Miller
41e5b8428f mount return backup_file
Fixes https://github.com/ansible-collections/ansible.posix/issues/126

Signed-off-by: Adam Miller <admiller@redhat.com>
2021-06-04 10:52:38 +05:30
Hideki Saito
cfff8a3806 Modify boot option handling on Linux systems
* Address the issue #28
* Modified behavior to set noauto option if boot is 'no' on Linux system
* Modified integration test to use filesize module instead of dd

Signed-off-by: Hideki Saito <saito@fgrep.org>
2021-06-01 14:21:01 +09:00
Hideki Saito
0bef7bb164 Fix boot option handling on Solaris correctly
* Fixes #184

Signed-off-by: Hideki Saito <saito@fgrep.org>
2021-05-13 15:12:50 +09:00
dkjii
18469dbb3e ansible.posix.mount: add absent_from_fstab option 2021-04-02 09:50:36 -04:00
quidame
c8b58875d9 add no_log=False to clear false-positives
Related modules: authorized_key, mount.
2021-03-19 09:07:14 +01:00
Adam Miller
ab01d216fc Content Collection 1.0.0 Release
Signed-off-by: Adam Miller <admiller@redhat.com>
2020-06-19 22:39:25 -05:00
Adam Miller
01d06f6be3 mount - fix module_util pathing issue for ansible 2.9
In Ansible 2.9 (pre 2.10 routing), the AnsiballZ creation of the payload
will add an extra directory to the module_util path because ismount.py
shares the same name as it's parent dir which creates an inconsistency
in the payload creation. This causes the Collection module
ansible.posix.mount to work in Ansible 2.10 but not 2.9, with this pull
request a simple renaming of the module_util which side steps this
inconsistency.

Fixes https://github.com/ansible-collections/ansible.posix/issues/21

Signed-off-by: Adam Miller <admiller@redhat.com>
2020-06-19 09:18:32 -05:00
Abhijeet Kasurde
75a5f83602
Partially revert "mount: Check if src exists before mounted (ansible/ansible#61752)" (#33)
This reverts part of ansible commit 72023d7462e78635264fd12bfdb23894b4163cba.

The immediate reason is that it breaks mounts where src is not a path.
Examples of such mounts are network-based filesystems such as nfs, cifs,
glusterfs, ceph, virtual filesystems such as tmpfs or overlayfs, and
also UUID-based mounts. It is too hard to come with an exhaustive list,
especially if we take non-Linux systems into account, so don't even try.

Additionally, it did not really fix the issue (ansible/ansible#59183) that
it intended to fix, because the mount could fail but leave a non-working
fstab entry for reasons other than non-existing src path.

Restore fstab and remove the mount point after a failed mount

Add a reminder that not only devices can be mounted

Fixes: ansible/ansible#65855
Fixes: ansible/ansible#67588
Fixes: ansible/ansible#67966

Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

Co-authored-by: Alexander E. Patrakov <patrakov@gmail.com>
2020-05-29 15:34:53 -05:00
Abhijeet Kasurde
74c8ca58e2
Remove Ansible metadata from modules (#25)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-05-21 11:55:32 -05:00
Abhijeet Kasurde
d9e0140b66
Update EXAMPLES section in modules (#27)
Update EXAMPLES section in modules to use FQCN

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-05-21 11:54:20 -05:00
Alex Shafer
147caed10d
Copy and adjust changes from ansible/ansible#59530 (#14) 2020-04-29 16:41:50 -05:00
Ansible Core Team
6f928621f0 Initial commit 2020-03-09 13:15:28 +00:00