ansible ansible_os_family == "RedHat" and ansible_lsb.major_release|int >= 6 转为数字比大小

字符串转换为数字型再去比较

tasks:
  - shell: echo "only on Red Hat 6, derivatives, and later"
    when: ansible_os_family == "RedHat" and ansible_lsb.major_release|int >= 6



原文地址:https://www.cnblogs.com/gaoyuechen/p/9076915.html