You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.6 KiB

  1. ---
  2. - hosts: localhost
  3. gather_facts: false
  4. become: no
  5. vars:
  6. minimal_ansible_version: 2.9.0
  7. minimal_ansible_version_2_10: 2.10.11
  8. maximal_ansible_version: 2.12.0
  9. ansible_connection: local
  10. tags: always
  11. tasks:
  12. - name: "Check {{ minimal_ansible_version }} <= Ansible version < {{ maximal_ansible_version }}"
  13. assert:
  14. msg: "Ansible must be between {{ minimal_ansible_version }} and {{ maximal_ansible_version }}"
  15. that:
  16. - ansible_version.string is version(minimal_ansible_version, ">=")
  17. - ansible_version.string is version(maximal_ansible_version, "<")
  18. tags:
  19. - check
  20. - name: "Check Ansible version > {{ minimal_ansible_version_2_10 }} when using ansible 2.10"
  21. assert:
  22. msg: "When using Ansible 2.10, the minimum supported version is {{ minimal_ansible_version_2_10 }}"
  23. that:
  24. - ansible_version.string is version(minimal_ansible_version_2_10, ">=")
  25. - ansible_version.string is version(maximal_ansible_version, "<")
  26. when:
  27. - ansible_version.string is version('2.10.0', ">=")
  28. tags:
  29. - check
  30. - name: "Check that python netaddr is installed"
  31. assert:
  32. msg: "Python netaddr is not present"
  33. that: "'127.0.0.1' | ipaddr"
  34. tags:
  35. - check
  36. # CentOS 7 provides too old jinja version
  37. - name: "Check that jinja is not too old (install via pip)"
  38. assert:
  39. msg: "Your Jinja version is too old, install via pip"
  40. that: "{% set test %}It works{% endset %}{{ test == 'It works' }}"
  41. tags:
  42. - check