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’’’
`
sivel
(sivel)
May 4, 2020, 6:19pm
2
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
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
sivel
(sivel)
May 4, 2020, 6:56pm
4
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.
Maybe it was experimental plug in …
as i see it used to be or it merged and then removed
https://github.com/ansible/ansible/pull/8062
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 ?
sivel
(sivel)
May 4, 2020, 9:18pm
8
There is no way to prevent registering if the task is skipped.
You should register to different variable names to avoid overwriting.