Hi,

I am trying to copy the  contents from a register output  to a file  in the 
local server.
However , I have challenges in re-calling the variable filename in the copy 
command.

Correct me what I am missing. in dest="{{ vars[ {{ comp_file }} ] }}"  or 
"{{ compare_out.stdout }}"  in the last lines ..


[vee@server]$ grep comp_file  vars/postcheck_vars.yml
comp_file: /logs/{{ exec_date }}/{{ inventory_hostname }}-compare-{{{ 
exec_date }}.txt

[vee@server]$ cat  compare_sanity.yml
- name: comparing file1 and file2 
  local_action: command /usr/bin/sdiff "{{ logs_dir }}"{{ 
inventory_hostname }}-Pre-{{ exec_date }}.txt   "{{ logs_dir }}"{{ 
inventory_hostname }}-Post-{{ exec_date }}.txt
  register: compare_out
  ignore_errors: yes
  no_log: True

- name: create output  file
  local_action:
    copy   content="{{ compare_out.stdout }}" dest="{{ vars[ {{ comp_file 
}} ] }}"
  [vee@server]$


-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/a1e96432-f332-4bb4-974a-4c556efd447fn%40googlegroups.com.

Reply via email to