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.

32 lines
1.0 KiB

  1. ---
  2. - hosts: localhost
  3. gather_facts: false
  4. become: no
  5. vars:
  6. minimal_ansible_version: 2.9.0
  7. maximal_ansible_version: 2.11.0
  8. ansible_connection: local
  9. tasks:
  10. - name: "Check {{ minimal_ansible_version }} <= Ansible version < {{ maximal_ansible_version }}"
  11. assert:
  12. msg: "Ansible must be between {{ minimal_ansible_version }} and {{ maximal_ansible_version }}"
  13. that:
  14. - ansible_version.string is version(minimal_ansible_version, ">=")
  15. - ansible_version.string is version(maximal_ansible_version, "<")
  16. tags:
  17. - check
  18. - name: "Check that python netaddr is installed"
  19. assert:
  20. msg: "Python netaddr is not present"
  21. that: "'127.0.0.1' | ipaddr"
  22. tags:
  23. - check
  24. # CentOS 7 provides too old jinja version
  25. - name: "Check that jinja is not too old (install via pip)"
  26. assert:
  27. msg: "Your Jinja version is too old, install via pip"
  28. that: "{% set test %}It works{% endset %}{{ test == 'It works' }}"
  29. tags:
  30. - check