From 07d9366ed8acca3a94b2f5facec1fbf157920179 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Mon, 20 Mar 2017 10:56:35 -0400 Subject: [PATCH] added 'existing' back fixes #22785 --- lib/ansible/module_utils/basic.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ansible/module_utils/basic.py b/lib/ansible/module_utils/basic.py index f3230e1375..448154cb7b 100644 --- a/lib/ansible/module_utils/basic.py +++ b/lib/ansible/module_utils/basic.py @@ -1142,6 +1142,8 @@ class AnsibleModule(object): b_path = os.path.expanduser(os.path.expandvars(b_path)) path = to_text(b_path, errors='surrogate_then_strict') + existing = self.get_file_attributes(b_path) + if existing.get('attr_flags','') != attributes: attrcmd = self.get_bin_path('chattr') if attrcmd: