Advertisement
Guest User

Untitled

a guest
Jun 29th, 2021
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. ---
  2. #- name: Checking docker SDK version
  3. # command: "{{ ansible_python.executable }} -c \"import docker; print(docker.__version__)\""
  4. # register: result
  5. # changed_when: false
  6. # when: inventory_hostname in groups['baremetal']
  7. # failed_when: result is failed or result.stdout is version(docker_py_version_min, '<')
  8.  
  9. # NOTE(osmanlicilegi): ansible_version.full includes patch number that's useless
  10. # to check. as ansible_version does not provide major.minor in dict, we need to
  11. # set it as variable.
  12. - name: Checking Ansible version
  13. vars:
  14. ansible_version_host: "{{ ansible_version.major }}.{{ ansible_version.minor }}"
  15. fail:
  16. msg: >-
  17. Ansible version should be between {{ ansible_version_min }} and {{ ansible_version_max }}.
  18. Current version is {{ ansible_version.full }} which is not supported.
  19. run_once: true
  20. when: ansible_version_host is version(ansible_version_min, '<') or ansible_version_host is version(ansible_version_max, '>')
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement