FL> - name: check if target server is CentOS 6 or Ubuntu 14
FL> fail: msg='unsupported platform detected!'
FL> when: (ansible_distribution != "CentOS" and
FL> ansible_distribution_major_version != "6") or (ansible_distribution !=
FL> "Ubuntu" and ansible_distribution_major_version != "14")
This logic seems wrong to me. With
"msg": "distro is CentOS and version is 6"
then your when turns into
when: (False and False) or (True and True)
aka
when: False or True
aka True. Right?
I think you want something more like
when: NOT (CentOS 6 or Ubuntu 14)
than like
when: (not CentOS 6) or (not Ubuntu 14)
Because you're always going to be not one of those things -- you need to
negate the whole or.
-Josh (
j...@care.com)
This email is intended for the person(s) to whom it is addressed and may contain information that is PRIVILEGED or CONFIDENTIAL. Any unauthorized use, distribution, copying, or disclosure by any person other than the addressee(s) is strictly prohibited. If you have received this email in error, please notify the sender immediately by return email and delete the message and any attachments from your system.