mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
Properly detect is_chroot fact on XFS for non-root (#56899)
Fixes #56437
This commit is contained in:
committed by
Brian Coca
parent
fca2a4c68b
commit
6e66ea9f78
2
changelogs/fragments/56437-is_chroot-xfs.yaml
Normal file
2
changelogs/fragments/56437-is_chroot-xfs.yaml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
bugfixes:
|
||||||
|
- facts - properly detect is_chroot on XFS for non-root users (https://github.com/ansible/ansible/issues/56437)
|
||||||
@@ -31,6 +31,8 @@ def is_chroot(module=None):
|
|||||||
rc, out, err = module.run_command(cmd)
|
rc, out, err = module.run_command(cmd)
|
||||||
if 'btrfs' in out:
|
if 'btrfs' in out:
|
||||||
fs_root_ino = 256
|
fs_root_ino = 256
|
||||||
|
elif 'xfs' in out:
|
||||||
|
fs_root_ino = 128
|
||||||
|
|
||||||
is_chroot = (my_root.st_ino != fs_root_ino)
|
is_chroot = (my_root.st_ino != fs_root_ino)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user