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.

34 lines
1.1 KiB

  1. ---
  2. - name: Check Ansible version
  3. hosts: all
  4. gather_facts: false
  5. become: no
  6. run_once: true
  7. vars:
  8. minimal_ansible_version: 2.16.4
  9. maximal_ansible_version: 2.17.0
  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 }} exclusive - you have {{ ansible_version.string }}"
  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 that python netaddr is installed"
  21. assert:
  22. msg: "Python netaddr is not present"
  23. that: "'127.0.0.1' | ansible.utils.ipaddr"
  24. tags:
  25. - check
  26. # CentOS 7 provides too old jinja version
  27. - name: "Check that jinja is not too old (install via pip)"
  28. assert:
  29. msg: "Your Jinja version is too old, install via pip"
  30. that: "{% set test %}It works{% endset %}{{ test == 'It works' }}"
  31. tags:
  32. - check