Oefenweb / ansible-postfix

Ansible role to set up postfix in Debian-like systems
MIT License
173 stars 82 forks source link

no_log fails on Ansible 2.10 #98

Closed vladgh closed 3 years ago

vladgh commented 4 years ago

https://github.com/Oefenweb/ansible-postfix/blob/123eb6a1be24c31ad0f57cc7f532c2f8681b3c4d/tasks/main.yml#L70

The line above fails on Ansible 2.10.

A simple way to reproduce is with:

- name: Debug
  hosts: all
  tasks:
    - debug:
        msg: "Check is {{ ansible_check_mode }}"
      no_log: not ansible_check_mode
TASK [d] *********************************************************************************
fatal: [vdev]: FAILED! => {"censored": "the output has been hidden due to the fact that 'no_log: true' was specified for this result"}
tersmitten commented 4 years ago

And how are we supposed to fix it (in a backward compatible way)?

vladgh commented 4 years ago

I just did some tests, and I think simply quoting the variable should fix it (tested with Ansible 2.9.13 and 2.10.1):

---
- name: Debug
  hosts: all
  tasks:
    - debug:
        msg: "Check is {{ ansible_check_mode }}"
      no_log: "{{ not ansible_check_mode }}"
Screen Shot 2020-09-25 at 7 14 36 AM
tersmitten commented 4 years ago

Can you make a PR?

seocam commented 3 years ago

This is also affecting me.

vladgh commented 3 years ago

I have PR opened for this, and I have more work stashed, but I didn't have time to finish it. It requires quite a few IFs in order to work on permutations and combinations of specific versions of python/ansible/ansible-lint, and I find it very hard to come up with a clean and elegant solution.

thiagoferreiraw commented 2 years ago

@seocam, were you able to work around this error?

tersmitten commented 2 years ago

Isn't this fixed in the last version?

@seocam @thiagoferreiraw

thiagoferreiraw commented 2 years ago

@tersmitten, yes it is!

Thank you very much!