首页 > 技术文章 > ansible ansible_os_family == "RedHat" and ansible_lsb.major_release|int >= 6 转为数字比大小

gaoyuechen 2018-05-23 14:54 原文

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

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



推荐阅读