Hi,

Thanks for the tip. The first task is harmful, as it creates an EBS volume in AWS. I tricked ansible creating a fact when thevar.skipped is defined, adding the pending attribute to it and then following on check mode. If the variable is registered (not on check mode), then the fact will not be set.


-- anderson


On 31/05/2016 20:36, Johannes Kastl wrote:
On 31.05.16 20:37 [email protected] wrote:

The problem is, one task register a variable and the other tries to access
its attribute, which fails because it is not defined. I tried to use
ec2_volume.skipped check, but it stills tries to access some its attribute
and fail the check.
If the first task does not harm (e.g. just look up a file or list a
directory) then set it to 'always_run: yes'. So the task is executed
even in check mode, and thus the variable is correctly registered.

Unfortunately that won't work if the task uses a file that a previous
task would create, were it not in check mode...

Johannes


--
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/c4e3b8a6-6dd6-dbf7-b2d3-eb37803d731f%40boxever.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to