what is set_when_task_skipped=false replacment in ansible 2.9?

50 views
Skip to first unread message

Meir Yanovich

unread,
May 4, 2020, 2:16:16 PM5/4/20
to Ansible Project
i have old code which use set_when_task_skipped=false in register 
now it is not supported any more 
I'm getting on :

- name: Find location
 
register: login_app set_when_task_skipped=false
 
when: result.stat.exists == True


fatal: [10.0.4.211]: FAILED! =>
  msg
: 'Invalid variable name in ''register'' specified: 'login_app set_when_task_skipped=false'''



Matt Martz

unread,
May 4, 2020, 2:20:20 PM5/4/20
to ansible...@googlegroups.com
To my knowledge, that has in the past created a literal variable named `login_app set_when_task_skipped=false`

`set_when_task_skipped` isn't a feature of Ansible.

We've recently made some changes to ensure that variables are legal.  Likely you just want:

`register: login_app`

--
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-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/9f0180e7-b516-408b-b442-620284acdb1d%40googlegroups.com.


--
Matt Martz
@sivel
sivel.net

Meir Yanovich

unread,
May 4, 2020, 2:50:14 PM5/4/20
to ansible...@googlegroups.com
Then it failed when I remove it and when 
The register var is not set ,
So basically what is the right way to do it ? 
The same function set_when_task_skipped=false
Did

You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/L-qk9XOnWBw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAD8N0v_OseR%3DssHP%3DKPHMuCHkE%2B7RHm1cWx6WnUuHbpb7hA%2BDg%40mail.gmail.com.

Matt Martz

unread,
May 4, 2020, 2:58:02 PM5/4/20
to ansible...@googlegroups.com
set_when_task_skipped=false is not a feature of Ansible and has never done anything.

I see a stackoverflow post seeming to indicate it was a feature.  However, that is incorrect.

Whatever you expected it to do, never worked to begin with.

Meir Yanovich

unread,
May 4, 2020, 3:02:20 PM5/4/20
to ansible...@googlegroups.com
Maybe it was  experimental plug in ...

Meir Yanovich

unread,
May 4, 2020, 4:48:37 PM5/4/20
to Ansible Project
as i see it used to be or it merged and then removed 

To unsubscribe from this group and stop receiving emails from it, send an email to ansible...@googlegroups.com.


--
Matt Martz
@sivel
sivel.net

--
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/L-qk9XOnWBw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible...@googlegroups.com.

--
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...@googlegroups.com.

Meir Yanovich

unread,
May 4, 2020, 5:16:38 PM5/4/20
to Ansible Project
basically, after looking into the entire internet again when regarding to ansible i see that there is no info or no simple answer on :
"how to not set the register variable when the task is skipped "
so what is the standard way ?


On Monday, May 4, 2020 at 9:58:02 PM UTC+3, Matt Martz wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to ansible...@googlegroups.com.


--
Matt Martz
@sivel
sivel.net

--
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/L-qk9XOnWBw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible...@googlegroups.com.

--
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...@googlegroups.com.

Matt Martz

unread,
May 4, 2020, 5:20:47 PM5/4/20
to ansible...@googlegroups.com
There is no way to prevent registering if the task is skipped.

You should register to different variable names to avoid overwriting.

To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/59db1108-34d2-43ee-9dce-e0a21240d91d%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages