---

- name: check if Google Chrome is downloaded ?
  shell: "{{playbook_dir}}/roles/chrome/scripts/grepChrome.sh -i='google-chrome-stable_current_x86_64.rpm'"
  register: chrome_exists
  changed_when: false
  failed_when: false
  become: yes

- debug:
    msg: "{{ chrome_exists.stdout }}"

- name: get Google Chrome (as RPM file)
  get_url:
    url:  "https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm"
    dest: "/tmp/google-chrome-stable_current_x86_64.rpm"
  when: chrome_exists == ""

- name: install Google Chrome
  yum:
    name: /tmp/google-chrome-stable_current_x86_64.rpm
    state: present
---

- name: check if Google Chrome is downloaded ?
  shell: "{{playbook_dir}}/roles/chrome/scripts/grepChrome.sh -i='google-chrome-stable_current_x86_64.rpm'"
  register: chrome_exists
  changed_when: false
  failed_when: false
  become: yes

- debug:
    msg: "{{ chrome_exists.stdout }}"

- block:

  - name: get Google Chrome (as RPM file)
    get_url:
    url:  "https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm"
    dest: "/tmp/google-chrome-stable_current_x86_64.rpm"
  
  - name: install Google Chrome
    yum:
      name: /tmp/google-chrome-stable_current_x86_64.rpm
      state: present

  when: chrome_exists == ""
FIX : chrome - install of chrome only if chrome is downloaded before
[LAI] FIX : chrome - install of chrome only if chrome is downloaded before
