From aa910d884ff5bd3caf49099831e7263e2b29b746 Mon Sep 17 00:00:00 2001 From: David Galloway Date: Wed, 16 May 2018 15:46:38 -0400 Subject: [PATCH] ansible.py: Write "foo" to ~/.vault_pass.txt instead of touching ansible-playbook will not run with an empty vault password file. It will run if the password file has something in it even if it doesn't get used. Signed-off-by: David Galloway --- teuthology/task/ansible.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/teuthology/task/ansible.py b/teuthology/task/ansible.py index f0ad662f7d..dfc009feba 100644 --- a/teuthology/task/ansible.py +++ b/teuthology/task/ansible.py @@ -416,12 +416,13 @@ class CephLab(Ansible): super(CephLab, self).__init__(ctx, config) def begin(self): - # Emulate 'touch ~/.vault_pass.txt' to avoid ansible failing; - # in almost all cases we don't need the actual vault password + # Write foo to ~/.vault_pass.txt if it's missing. + # In almost all cases we don't need the actual vault password. + # Touching an empty file broke as of Ansible 2.4 vault_pass_path = os.path.expanduser('~/.vault_pass.txt') if not os.path.exists(vault_pass_path): - with open(vault_pass_path, 'a'): - pass + with open(vault_pass_path, 'w') as f: + f.write('foo') super(CephLab, self).begin() def _set_status(self, status): -- 2.39.5