SyntaxWarnings after System Update ansible 3.9.6, Python 3.8

Hi there,

I did an System update recently and now I get this Python warning:
SyntaxWarning: “is” with a literal. Did you mean “==”?

when I run my playbook. I guess it has to do with conditions like in this task:

  • name: Set users authorized keys
    authorized_key:
    user: “{{item.0.username}}”
    key: “{{item.1}}”
    state: “{{state}}”
    with_subelements:
  • “{{users}}”
  • ssh_authorized_keys
    when: item.ssh_authorized_keys is defined

Is there another way to set these conditions now or hao can I prevent this warnings. (The span the output)

Thanks and regards
Matthias

It has nothing to do with your playbook. Those warnings come from Python, and indicate that some code in a python library has an incorrect comparison.

Hey,

I use a python virtualenv and have the latest ansible 2.9 in my requirements.txt (ansible >= 2.9, <2.10); and I am on ansible 2.9.21 with this. I had some problems with older 2.9, which are still in repos like on or Ubuntu or FreeBSD. Maybe you would be able to resolve your problem with trying the same(?)

Cheers

Lars