On 8/13/20 1:49 PM, Gabriel Sousa wrote:
> i have this:
> 
> ---
> - hosts: all
>   vars:
>   - site: "{{ ansible_hostname | regex_replace('^(.{2}).*' ,'\\1' ) }}"
>   - datavg: DATAVG
>   - datavgpvs: /dev/sdb
>   - lv_int:
>     - { lv: app, size: "{{appS}}", vg: "{{datavg}}", fs: xfs, mount: "/app" }
> 
>  
> - hosts:
>   - a
>   become: yes
>   become_method: sudo
>   vars:
>   - appS: 30G
> 
>   tasks:
>   - name: Setup datavg LVs
>     lvol: lv={{item.lv}} state=present vg={{datavg}} size={{item.size}}
>     with_items: "{{ hostvars[all].lv_inst }}"
> 
> 
> but i have error in hostvars "' 'all' is undefined"

It's unclear why you don't loop over lv_int:

with_items: "{{ lv_int }}"

Otherwise use group variables to share variables between hosts.

Regards
        Racke

> 
> -- 
> 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 
> <mailto:ansible-project+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/e70ab19c-bd04-494c-bfca-887bfbb361dbn%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/e70ab19c-bd04-494c-bfca-887bfbb361dbn%40googlegroups.com?utm_medium=email&utm_source=footer>.


-- 
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration. Provisioning with Ansible.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/0334addf-84e2-cd9f-2de8-27f223861c32%40linuxia.de.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to