# Need to remove these packages before installing pyOpenSSL and urllib3.
- name: remove ubuntu-packaged libraries for python secure connections
  apt:
    name: python-openssl,python-urllib3
    state: absent
  become: yes

- name: install libraries required for python secure connections
  pip:
    name: "{{item.name}}"
    version: "{{item.version}}"
    state: present
  with_items:
      - { name: pyOpenSSL, version: 19.0.0 }
      - { name: cryptography, version: 2.8 }
      - { name: idna, version: 2.7 }
      - { name: certifi, version: 2019.11.28 }
      - { name: urllib3, version: 1.24.3 }
  become: yes
