# Porting from Ansible 2.19 to 2.14: unsafe conditionals

**URL:** <https://forum.ansible.com/t/porting-from-ansible-2-19-to-2-14-unsafe-conditionals/46545>\
**Category:** Get Help\
**Created:** [October 27, 2026, 6:34pm UTC](https://forum.ansible.com/t/porting-from-ansible-2-19-to-2-14-unsafe-conditionals/46545 "2026-10-27T18:34:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mirabilos](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mirabilos/32/9721_2.png) [@mirabilos](https://forum.ansible.com/u/mirabilos)\
**Post date:** [October 27, 2026, 6:34pm UTC](https://forum.ansible.com/t/porting-from-ansible-2-19-to-2-14-unsafe-conditionals/46545/1 "2026-10-27T18:34:12Z")

</div>

I’ve got the following setup, which works in 2.19:

In various roles’ `defaults` files, I have definitins like:

```auto
common_asserts_commonboth:
- that: thisisnotset is not defined
  err: "The 'thisisnotset' variable must not be defined."

```

Or:

```auto
common_asserts_unbound:
- that: not isschroot
  err: "The unbound role is unsuitable for using on chroots."

```

Then, in a common role, I’m collecting and testing these:

```auto
- name: LOCAL | ensure that prerequisites are met
  ansible.builtin.assert:
    that: "{{ item.that }}"
    fail_msg: "{{ item.err }}"
    quiet: true
  tags: always
  loop_control:
    label: "{{ item.that }}"
  loop: "{{ ([] + lookup('community.general.merge_variables', 'common_asserts_', initial_value=[], pattern_type='prefix')) }}"

```

This works in 2.19, but gives errors in 2.14 (which we need to still be able to manage e.g. buster-ELTS and OL8 hosts):

```auto
fatal: [xxxhostnamexxx]: FAILED! => {"msg": "The conditional check 'thisisnotset is not defined' failed. The error was: Conditional is marked as unsafe, and cannot be evaluated."}

```

Changing the third line to `that: item.that` is not correct, as that (pun not intended) only checks that the `that` member of `item` is set, but not the conditional enshrined within.
