---
# file: roles/python_env/tasks/main.yaml

- name: Inst - Update package cache (apt)
  ansible.builtin.apt:
    update_cache: true
    cache_valid_time: 3600
  when:
    - ansible_distribution|lower == 'ubuntu'
  tags:
    - common-inst-prerequisites

- name: Inst - Prerequisites
  ansible.builtin.package:
    name: "{{ packages | flatten(levels=1) }}"
    state: latest
  tags:
    - common-inst-prerequisites

- name: Inst - CSIT PIP requirements
  ansible.builtin.pip:
    name:
      - "ecdsa==0.18.0"
      - "paramiko==2.9.3"
      - "pycrypto==2.6.1"
      - "PyYAML==5.4.1"
      - "requests==2.25.1"
      - "robotframework==5.0.1"
      - "scapy==2.4.5"
      - "scp==0.14.4"
      - "ansible==5.10.0"
      - "ansible-core==2.12.7"
      - "dill==0.3.5.1"
      - "numpy==1.22.4"
      - "scipy==1.8.1"
      - "boto3==1.17.78"
      - "botocore==1.20.78"
      - "hdrhistogram==0.6.1"
      - "pandas==1.4.2"
      - "plotly==4.1.1"
      - "PTable==0.9.2"
      - "Sphinx==3.5.4"
      - "sphinx-rtd-theme==0.5.2"
      - "sphinxcontrib-applehelp==1.0.2"
      - "sphinxcontrib-devhelp==1.0.2"
      - "sphinxcontrib-htmlhelp==2.0.0"
      - "sphinxcontrib-jsmath==1.0.1"
      - "sphinxcontrib-programoutput==0.17"
      - "sphinxcontrib-qthelp==1.0.3"
      - "sphinxcontrib-robotdoc==0.11.0"
      - "sphinxcontrib-serializinghtml==1.1.5"
      - "ply==3.11"
      - "jsonschema==4.1.0"
      - "rfc3339-validator==0.1.4"
      - "rfc3987==1.3.8"
      - "alabaster==0.7.12"
      - "attrs==21.4.0"
      - "Babel==2.10.3"
      - "bcrypt==3.2.2"
      - "certifi==2022.6.15"
      - "cffi==1.15.1"
      - "chardet==4.0.0"
      - "cryptography==36.0.2"
      - "docutils==0.16"
      - "future==0.18.2"
      - "idna==2.10"
      - "imagesize==1.4.1"
      - "Jinja2==3.0.3"
      - "jmespath==0.10.0"
      - "MarkupSafe==2.1.1"
      - "packaging==21.3"
      - "pbr==5.9.0"
      - "pycparser==2.21"
      - "Pygments==2.12.0"
      - "PyNaCl==1.5.0"
      - "pyparsing==3.0.9"
      - "pyrsistent==0.18.1"
      - "python-dateutil==2.8.2"
      - "pytz==2022.1"
      - "resolvelib==0.5.4"
      - "retrying==1.3.3"
      - "s3transfer==0.4.2"
      - "six==1.16.0"
      - "snowballstemmer==2.2.0"
      - "urllib3==1.26.10"
  environment:
    ANSIBLE_SKIP_CONFLICT_CHECK: 1
  tags:
    - common-inst-pip