New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove file or directory with chattr in one task #79587
Comments
Files identified in the description: If these files are incorrect, please update the |
note: the module is probably skipping all chattr/chwon/chmod operations when it sees |
Will try working on this in the upcoming week. |
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)? |
…ent to ensure_absent
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: