From: Neha Ojha Date: Tue, 7 Aug 2018 16:54:29 +0000 (+0000) Subject: infrastructure-playbooks/lv-create.yml: use tempfile to create logfile X-Git-Tag: v3.1.0rc18~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=db0e06cbb6735ef765c7458c5ddb5883e99cc928;p=ceph-ansible.git infrastructure-playbooks/lv-create.yml: use tempfile to create logfile Signed-off-by: Neha Ojha (cherry picked from commit f65f3ea89fdba98057172e32e1a43ee6370c04d9) Signed-off-by: Sébastien Han --- diff --git a/infrastructure-playbooks/lv-create.yml b/infrastructure-playbooks/lv-create.yml index 8dae60f17..9d4ee8077 100644 --- a/infrastructure-playbooks/lv-create.yml +++ b/infrastructure-playbooks/lv-create.yml @@ -87,8 +87,17 @@ - "{{ hdd_devices }}" # Write ending configuration logfile - - name: write output for osds.yml to logfile /tmp/logfile.txt + - name: create temporary logfile + tempfile: + state: file + suffix: logfile + register: temp_file + + - name: print logfile details + debug: var=temp_file + + - name: write output for osds.yml to logfile /tmp/ansible.*logfile copy: content: "{{ logfile }}" - dest: "/tmp/logfile.txt" + dest: "{{ temp_file.path }}" delegate_to: localhost