You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
felipenazario opened this issue
Dec 13, 2022
· 4 comments
· May be fixed by #83111
Labels
affects_2.11bugThis issue/PR relates to a bug.easyfixThis issue is considered easy to fix by aspiring contributors.has_prThis issue has an associated PR.moduleThis issue/PR relates to a module.verifiedThis issue has been verified/reproduced by maintainer
note: the module is probably skipping all chattr/chwon/chmod operations when it sees state=absent
s-hertel
added
easyfix
This issue is considered easy to fix by aspiring contributors.
verified
This issue has been verified/reproduced by maintainer
and removed
needs_verified
This issue needs to be verified/reproduced by maintainer
labels
Dec 6, 2023
The reason why the module can create files or directories with attributes in one task is because ensure_directory calls set_fs_attributes_if_different → set_attributes_if_different which will set the attribute of the directory to +a. This function is not called in ensure_absent (which handles deletions). Should we consider a way to add set_fs_attributes_if_different to ensure_absent or should we use a method of fixing this bug that is more specific to +a and -a attributes (i.e. checking in ensure_absent for the append-only attribute and removing it before deletion)?
affects_2.11bugThis issue/PR relates to a bug.easyfixThis issue is considered easy to fix by aspiring contributors.has_prThis issue has an associated PR.moduleThis issue/PR relates to a module.verifiedThis issue has been verified/reproduced by maintainer
Summary
I'm trying to delete a directory that has the attribute with chattr +a, but I can not do it even specifing -a. I believe it could done in two tasks.
1 - Create directory with chattr +a
2 - Delete directory with chattr -a
Today is only possible in three tasks.
1 - Create directory with chattr +a
2 - Remove the attribute -a of the directory
3 - Delete directory
Since the module is able to create files or directories with attributes in one task, it should also be able to undo it.
Issue Type
Bug Report
Component Name
ansible.builtin.file
Ansible Version
Configuration
OS / Environment
NAME="openSUSE Leap"
VERSION="15.3"
ID="opensuse-leap"
ID_LIKE="suse opensuse"
VERSION_ID="15.3"
PRETTY_NAME="openSUSE Leap 15.3"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:leap:15.3"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org/"
Steps to Reproduce
Expected Results
Actual Results
Code of Conduct
The text was updated successfully, but these errors were encountered: