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.0 KiB

  1. ---
  2. - hosts: localhost
  3. gather_facts: false
  4. become: no
  5. vars:
  6. minimal_ansible_version: 2.11.0
  7. maximal_ansible_version: 2.13.0
  8. ansible_connection: local
  9. tags: always
  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 that python netaddr is installed"
  20. assert:
  21. msg: "Python netaddr is not present"
  22. that: "'127.0.0.1' | ipaddr"
  23. tags:
  24. - check
  25. # CentOS 7 provides too old jinja version
  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