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



posted @ 2018-05-23 14:54  滴滴滴  阅读(1782)  评论(0编辑  收藏  举报