I'm glad to know about set_fact now. Thanks Michael!
On Thursday, August 7, 2014 6:30:56 PM UTC-3, Michael DeHaan wrote:
>
> "Also, maybe print a warning when the same register is being used more
> than once?"
>
> It's somewhat common for someone to use a repeated variable "result", so
> this isn't really a problem.
>
> The above conditionals could be made easier using "set_fact" BTW:
>
> - set_fact: path=default_path_goes_here
> - set_fact: path=other_path
> when: ansible_hostname | match("^xy-")
>
> +1 for cowsay installs. Don't see it enough :)
>
>
>
>
> On Thu, Aug 7, 2014 at 8:34 AM, Manuel Quiñones <[email protected]
> <javascript:>> wrote:
>
>>
>>
>> On Wednesday, August 6, 2014 12:02:59 PM UTC-3, Michael DeHaan wrote:
>>>
>>> Can you share what a failure means in the above, any output you have,
>>> and what ansible version you are running?
>>>
>>> Thanks!
>>>
>>
>> Hi Michael,
>>
>> ansible version is 1.6.3, and below is a sample output. You will see
>> that debug task is being executed only for the vars registered in the
>> second shell task. For failures I was wrong, sorry, there are all
>> "failed=0" in this run.
>>
>> Might be a good addition to the docs that register always store, even
>> when tasks are skipped. I can write a line and send a pull request if you
>> want.
>> Also, maybe print a warning when the same register is being used more
>> than once?
>>
>> Thanks!
>>
>> ______________________
>> < PLAY [test register under conditionals] >
>> ----------------------
>> \ ^__^
>> \ (oo)\_______
>> (__)\ )\/\
>> ||----w |
>> || ||
>>
>>
>> _________________
>> < GATHERING FACTS >
>> -----------------
>> \ ^__^
>> \ (oo)\_______
>> (__)\ )\/\
>> ||----w |
>> || ||
>>
>>
>> ok: [az-123]
>> ok: [xy-01]
>> ok: [xy-02]
>> ok: [az-122]
>> ok: [xy-03]
>> __________________________________
>> < TASK: shell echo /opt/cache/www/ >
>> ----------------------------------
>> \ ^__^
>> \ (oo)\_______
>> (__)\ )\/\
>> ||----w |
>> || ||
>>
>>
>> skipping: [az-122]
>> changed: [xy-01]
>>
>> cmd:
>> echo /opt/cache/www/
>>
>> start:
>> 2014-08-07 08:08:00.679567
>>
>> end:
>> 2014-08-07 08:08:00.682666
>>
>> delta:
>> 0:00:00.003099
>>
>> stdout:
>> /opt/cache/www/
>>
>> stderr:
>>
>> changed: [xy-02]
>>
>> cmd:
>> echo /opt/cache/www/
>>
>> start:
>> 2014-08-07 08:08:01.152222
>>
>> end:
>> 2014-08-07 08:08:01.155408
>>
>> delta:
>> 0:00:00.003186
>>
>> stdout:
>> /opt/cache/www/
>>
>> stderr:
>>
>> skipping: [az-123]
>> changed: [xy-03]
>>
>> cmd:
>> echo /opt/cache/www/
>>
>> start:
>> 2014-08-07 13:08:02.013062
>>
>> end:
>> 2014-08-07 13:08:02.015739
>>
>> delta:
>> 0:00:00.002677
>>
>> stdout:
>> /opt/cache/www/
>>
>> stderr:
>>
>> _________________________________
>> < TASK: shell echo /mnt/code/www/ >
>> ---------------------------------
>> \ ^__^
>> \ (oo)\_______
>> (__)\ )\/\
>> ||----w |
>> || ||
>>
>>
>> skipping: [xy-03]
>> skipping: [xy-01]
>> skipping: [xy-02]
>> changed: [az-123]
>>
>> cmd:
>> echo /mnt/code/www/
>>
>> start:
>> 2014-08-07 12:08:02.730487
>>
>> end:
>> 2014-08-07 12:08:02.733503
>>
>> delta:
>> 0:00:00.003016
>>
>> stdout:
>> /mnt/code/www/
>>
>> stderr:
>>
>> changed: [az-122]
>>
>> cmd:
>> echo /mnt/code/www/
>>
>> start:
>> 2014-08-07 12:08:03.669314
>>
>> end:
>> 2014-08-07 12:08:03.673185
>>
>> delta:
>> 0:00:00.003871
>>
>> stdout:
>> /mnt/code/www/
>>
>> stderr:
>>
>> _________________________________
>> < TASK: debug var=www_data.stdout >
>> ---------------------------------
>> \ ^__^
>> \ (oo)\_______
>> (__)\ )\/\
>> ||----w |
>> || ||
>>
>>
>> ok: [az-123] => {
>> "www_data.stdout": "/mnt/code/www/"
>> }
>> skipping: [xy-02]
>> skipping: [xy-01]
>> skipping: [xy-03]
>> ok: [az-122] => {
>> "www_data.stdout": "/mnt/code/www/"
>> }
>> ____________
>> < PLAY RECAP >
>> ------------
>> \ ^__^
>> \ (oo)\_______
>> (__)\ )\/\
>> ||----w |
>> || ||
>>
>>
>> az-123 : ok=3 changed=1 unreachable=0
>> failed=0
>> xy-01 : ok=2 changed=1 unreachable=0
>> failed=0
>> xy-02 : ok=2 changed=1 unreachable=0
>> failed=0
>> xy-03 : ok=2 changed=1 unreachable=0
>> failed=0
>> az-122 : ok=3 changed=1 unreachable=0
>> failed=0
>>
>>
>>
>> --
>> 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] <javascript:>.
>> To post to this group, send email to [email protected]
>> <javascript:>.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/015d7d4b-6efb-4873-8c0d-6f14fb2215b2%40googlegroups.com
>>
>> <https://groups.google.com/d/msgid/ansible-project/015d7d4b-6efb-4873-8c0d-6f14fb2215b2%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
--
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/cb14477d-4b8a-493e-8c14-5d0f0f943881%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.