infrastructure-playbooks/lv-create.yml: use tempfile to create logfile

Signed-off-by: Neha Ojha <nojha@redhat.com>
pull/3036/head
Neha Ojha 2018-08-07 16:54:29 +00:00 committed by Sébastien Han
parent 65fdad0723
commit f65f3ea89f
1 changed files with 11 additions and 2 deletions

View File

@ -87,8 +87,17 @@
- "{{ hdd_devices }}" - "{{ hdd_devices }}"
# Write ending configuration logfile # 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: copy:
content: "{{ logfile }}" content: "{{ logfile }}"
dest: "/tmp/logfile.txt" dest: "{{ temp_file.path }}"
delegate_to: localhost delegate_to: localhost