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.

21 lines
438B

  1. ---
  2. - name: check version of ansible
  3. shell: pip3 show ansible | grep Version | cut -d ' ' -f 2
  4. ignore_errors: true
  5. changed_when: false
  6. register: get_ansible_version
  7. - name: old ansible pip package removed
  8. pip:
  9. name: ansible
  10. state: absent
  11. executable: pip3
  12. when: "{{ ansible_installed_version is version('2.10', '<') }}"
  13. - name: ansible pip package
  14. pip:
  15. name: ansible
  16. state: latest
  17. executable: pip3