From: David Galloway Date: Wed, 16 May 2018 19:46:38 +0000 (-0400) Subject: ansible.py: Write "foo" to ~/.vault_pass.txt instead of touching X-Git-Tag: 1.1.0~342^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F1173%2Fhead;p=teuthology.git 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 --- diff --git a/teuthology/task/ansible.py b/teuthology/task/ansible.py index f0ad662f7..dfc009feb 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):