---
- name: Import de la clé GPG google
  apt_key:
    id: 4CCA1EAF950CEE4AB83976DCA040830F7FAC5991
    url: https://dl-ssl.google.com/linux/linux_signing_key.pub
    keyring: /etc/apt/trusted.gpg.d/google.gpg

- name: Ajout du depot google
  apt_repository:
    # yamllint disable-line rule:line-length
    repo: deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/google.gpg] http://dl.google.com/linux/chrome/deb/ stable main
    update_cache: true
    filename: google-chrome

- name: install google-chrome-stable
  apt:
    pkg:
      - google-chrome-stable

- name: désactive l'avertissement chrome est contrôllé par un autre logiciel
  block:
    - name: répertoire policies
      file:
        state: directory
        path: /etc/opt/chrome/policies/managed
        mode: 0755
    - name: CommandLineFlagSecurityWarningsEnabled
      copy:
        dest: /etc/opt/chrome/policies/managed/managed_policies.json
        mode: 0644
        content: |
          { "CommandLineFlagSecurityWarningsEnabled": false }
