Merge "[Victoria and bellow] Ensure rights on the ansible.log file" into stable/victoria

This commit is contained in:
Zuul 2021-03-16 19:30:49 +00:00 committed by Gerrit Code Review
commit 01d9a7c737
1 changed files with 5 additions and 0 deletions

View File

@ -120,6 +120,11 @@ def write_default_ansible_cfg(work_dir,
datetime.now().strftime("%Y-%m-%dT%H:%M:%S")) datetime.now().strftime("%Y-%m-%dT%H:%M:%S"))
os.rename(log_path, new_path) os.rename(log_path, new_path)
# Create the log file, and set some rights on it in order to prevent
# unwanted access
open(log_path, 'a').close()
os.chmod(log_path, 0o640)
config.set('defaults', 'forks', str(min( config.set('defaults', 'forks', str(min(
multiprocessing.cpu_count() * 4, 100))) multiprocessing.cpu_count() * 4, 100)))
config.set('defaults', 'timeout', '30') config.set('defaults', 'timeout', '30')