Thursday, December 24, 2020

How to install Google Chrome using Ansible

 Description: Here I have explained, How to install Google Chrome using Ansible

  • Download Google Chrome installer in Ansible machine using wget command 

# wget https://dl.google.com/tag/s/appguid%3D%7B8A69D345-D564-463C-AFF1-A69D9E530F96%7D%26iid%3D%7B57CCB1C3-27A4-5306-3665-D71F1CA0A38D%7D%26lang%3Den%26browser%3D4%26usagestats%3D0%26appname%3DGoogle%2520Chrome%26needsadmin%3Dtrue%26ap%3Dx64-stable-statsdef_0%26brand%3DGCEB/dl/chrome/install/GoogleChromeEnterpriseBundle64.zip


  • Create Ansible playbook for google chrome as follow. Below playbook will copy installer zip file then extract and run the installer file
# vi google_chrome.yaml

- hosts: win
gather_facts: no
tasks:
- name: Copy the bundle.zip
win_copy:
src: GoogleChromeEnterpriseBundle64.zip
dest: C:\\Temp\\
- name: Extract the bundle
win_unzip:
src: c:\\Temp\\GoogleChromeEnterpriseBundle64.zip
dest: C:\\Temp\\Chrome
- name: Install Chrome
win_package:
path: C:\\Temp\\Chrome\\Installers\\GoogleChromeStandaloneEnterprise64.msi
product_id: '{B93553B7-F366-388E-ADB8-EDEAC41EADC2}'
wait: yes
state: present
when: ACTION == "Install"
- name: Uninstall Chrome
win_package:
path: C:\\Temp\\Chrome\\Installers\\GoogleChromeStandaloneEnterprise64.msi
product_id: '{B93553B7-F366-388E-ADB8-EDEAC41EADC2}'
wait: yes
state: absent
when: ACTION == "Uninstall"
# - name: Uninstall Chrome Update helper
# win_package:
# path: C:\\Temp\\Chrome\\Installers\\GoogleChromeStandaloneEnterprise64.msi
# wait: yes
# state: absent
# when: ACTION == "Uninstall"
- name: Clean up the bundle.zip
win_file:
path: C:\\Temp\\GoogleChromeEnterpriseBundle64.zip
state: absent
- name: Clean up the bundle
win_file:
path: C:\\Temp\\Chrome
state: absent

Run google_chrome playbook using ansible

# ansible-playbook google_chrome.yaml -e ACTION=Install

  • Once it runs successfully verify in windows machine you will get in the installed software list


4 comments:

  1. usefull for many IT people

    ReplyDelete
  2. Much appreciated! I was having trouble downloading Chrome and didn't want to use Chocolatey

    ReplyDelete
    Replies
    1. Try to download using google from below URL
      https://support.google.com/chrome/a/answer/7650032?hl=en

      Delete