Hola buenas, 

¿por que se dan estas incongruencias al usar variables en el modulo copy en 
su argumento dest.?


---
- hosts: localhost
  vars:
    PathLs: /etc/ansible/
    Folder: /ansible/

  tasks:
    - name: Ejecuta script
      script: "{{ PathLs }}ls.sh -al"
      register: Log_Step1

    - name: volcamos la salida a consola
      debug: var=Log_Step1.stdout_lines

    - name: volcamos la salida a fichero
      copy:
         content: |
             {% for lines in  Log_Step1.stdout_lines %}
             {{ lines }}
             {% endfor %}
#         dest: /etc/ansible/logls.txt          # usando esta linea ok
#         dest: /etc/{{ Folder }}/logls.txt    # usando esta linea ok.
#         dest: {{ PathLs }}logls.txt           # usando esto falla.
         dest: "{{ PathLs }}logls.txt"          # usando esta linea ok.


¿por que en el caso de que comience por variable, tiene que usarse 
comillas, y en los otros casos no?

Un saludo.

-- 
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/5f4b362a-f71d-4f01-b6e1-5e329ce1a1ab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to