ansible 2.2.1.0
Linux 2.6.32-504.el6.x86_64 #1 SMP Tue Sep 16 01:56:35 EDT 2014 x86_64
x86_64 x86_64 GNU/Linux
El viernes, 30 de junio de 2017, 14:24:13 (UTC+2), Josu Vilda escribió:
When assigning variables under certain conditions, if there is no match,
> the last condition is erroneously assigned.
>
> Ej:
>
> ---
> - hosts: hostwin
> vars:
> # Definimos el paquete a instalar según el sistema operativo.
> - package_name: httpd
> when: ansible_os_family == "Red Hat"
> - package_name: apache2
> when: ansible_os_family == "Debian"
>
> tasks:
>
> # 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
>
>
>
> # ansible-playbook playbooks/test-httpd.yml
> PLAY [hostwin] ***************************************
> TASK [setup]
> *******************************************************************
> ok: [hostwin]
> TASK [Consulta sobre la instalacion del paquete apache2 en *Windows*]
> ************
> [Consulta sobre la instalacion del paquete apache2 en *Windows*]
> Acepta la instalacion del paquete apache2 en *Windows* :
> ok: [hostwin]
> PLAY RECAP
> *********************************************************************
> hostwin : ok=2 changed=0 unreachable=0 failed=0
>
>
>
> This should be null or return error, but do not assign any one.
>
>
>
--
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/6f83d2f9-0060-495b-a040-ce5adbb64915%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.