Hi Brian,

Can you elaborate on the several things that are wrong with the approach 
taken above? It seems dynamic variables do not carry over from each play. 
Is this intentional ? 

Your suggestion would work, but won't that require server_B to have access 
to server_A. What if that is not an option? It's possible to use fetch and 
store the file locally on the control server, but what if I am trying to 
avoid doing that? Is there another approach using slurp ?

Thanks.


On Monday, October 19, 2015 at 3:41:02 PM UTC-4, Brian Coca wrote:
>
> several things wrong there, but im just going to give you some thing 
> that should 'just work' 
>
> - name: part one of playbook 
>   hosts: server_A 
>   gather_facts: no 
>
>   tasks: 
>    - name: slurp a file 
>      slurp: src=/tmp/test.txt 
>      register: fileContents 
>
>    - debug: msg="{{ fileContents.content | b64decode }}" 
>
>    - template: src=file_contents.j2 dest=/tmp/test.txt 
>      delegate_to: server_B 
>
> where file_contents.j2: 
> {{ fileContents.content | b64decode }} 
>
>
> -- 
> Brian Coca 
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/8a05f97f-08ba-46a1-86d9-a568c61c1c86%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to