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.

33 lines
1.1 KiB

  1. ---
  2. - name: Check Ansible version
  3. hosts: all
  4. gather_facts: false
  5. become: false
  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. - name: "Check that jinja is not too old (install via pip)"
  27. assert:
  28. msg: "Your Jinja version is too old, install via pip"
  29. that: "{% set test %}It works{% endset %}{{ test == 'It works' }}"
  30. tags:
  31. - check