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.

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