From 4997f9bee04c0b2798cef5f5223f8890d2151953 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Mon, 18 Jun 2018 12:20:34 -0500 Subject: [PATCH] Just use chmod instead of file for log permissions The file module with recurse goes to the bad place when the content has a symlink to '.'. Rather than fighting it - just use chmod -R, which does what we want. Change-Id: Id3e23e67727d8ac7f29c87d6865b54dc729ccaf4 --- roles/upload-logs/tasks/main.yaml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/roles/upload-logs/tasks/main.yaml b/roles/upload-logs/tasks/main.yaml index 3cd4ca649..dcf8ad560 100644 --- a/roles/upload-logs/tasks/main.yaml +++ b/roles/upload-logs/tasks/main.yaml @@ -14,13 +14,14 @@ recurse: yes mode: 0775 + # Use chmod instead of file because ansible 2.5 file with recurse and + # follow can't really handle symlinks to . - name: Ensure logs are readable before uploading delegate_to: localhost - file: - path: "{{ zuul.executor.log_root }}/" - mode: u=rwX,g=rX,o=rX - state: directory - recurse: yes + command: "chmod -R u=rwX,g=rX,o=rX {{ zuul.executor.log_root }}/" + # ANSIBLE0007 chmod used in place of argument mode to file + tags: + - skip_ansible_lint - name: Upload logs to log server synchronize: