Absolutely. I use this technique to help combat the deprecation of include 
+ with_items. Something like:

```
- name: normalize apache_sites_list into variable file
  local_action: template dest={{ apache_sites_var_file }} 
src="apache_sites_normalized.j2"
  
- name: load normalized `apache_sites_normalized` from variable file
  include_vars: "{{ apache_sites_var_file }}"
  
- name: remove variable file
  local_action: file path={{ apache_sites_var_file }} state=absent
 ```

where apache_sites_var_file is defined as:

  apache_sites_var_file: /tmp/ansible.apache_sites.{{ inventory_hostname 
}}.yml

NOTE that it uses {{ inventory_hostname }} to help prevent issues with 
parallel execution.

May be an "anti pattern" in this establishment; but helped me write cleaner 
playbooks.


On Tuesday, March 25, 2014 9:35:18 PM UTC-5, qiu jiawei wrote:
>
> Now,the template module woule build the template file and send to the 
> remote host.
> Is it possible for not send to the remote host?
>
> I just want to see the file in local machine.
>

-- 
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/1a46e963-43c1-4959-8a83-dd7327fbe49a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to