Ok,
This would be the right way, right?

---
- hosts: hostwin

  vars:
     # definimos variables de ejemplo
     - site: localhost

  tasks:
     - name: Definimos variables para Red Hat.
       set_fact:
          package_name: "httpd"
       when:
          ansible_os_family == "Red Hat"

     - name: Definimos variables para Debian.
       set_fact:
          package_name: "apache2"
       when:
          ansible_os_family == "Debian"

     - name: Definimos variables para Windows.
       set_fact:
          package_name: "www"
       when:
          ansible_os_family == "Windows"


     # Consultamos al usuario si quiere actuar con dicho paquete.
     - name: Consulta sobre la instalacion del paquete {{package_name}} en 
{{ansible_os_family}}.
       pause: prompt="Acepta la instalacion del paquete {{package_name}} en 
{{ansible_os_family}} "
       register: confirmación

-- 
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/ec59507d-72c3-462d-85af-08abece36c9b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to