---
- block:
    - name: installation de unzip
      apt:
        pkg:
          - unzip
    - name: récupération de la version pour chromedriver
      uri:
        url: "https://chromedriver.storage.googleapis.com/LATEST_RELEASE"
        method: GET
        return_content: true
        status_code: 200
      register: _latest_release
      until: _latest_release.status == 200
      retries: 5
    - name: répertoire du binaire pour chromedriver
      file:
        state: directory
        path: /usr/local/bin/
        mode: 0755
    # yamllint disable rule:line-length
    - name: "télécharge de chromedriver pour la version {{ _latest_release.content }}"
      unarchive:
        src: "http://chromedriver.storage.googleapis.com/{{ _latest_release.content }}/chromedriver_linux64.zip"
        # yamllint enable rule:line-length
        dest: /usr/local/bin
        mode: "755"
        remote_src: true
