Wednesday, January 27, 2021

Install Office using ansible

In order to create a deployment package for Office 365 offline installation here’s what you have to do:

Download the Office deployment tool from the below microsoft link
https://www.microsoft.com/en-us/download/details.aspx?id=36778


For this demo i thought of installing only the word and exclude the remaining apps. Below is the configuration file which i am using  and in your case it might be different.

Config.xml

 

<Configuration>

<Add SourcePath="C:\Office365" OfficeClientEdition="64" Channel="Monthly">

<Product ID="O365ProPlusRetail">

<Language ID="en-us" />

<ExcludeApp ID="Publisher" />

<ExcludeApp ID="Access" />

<ExcludeApp ID="Excel" />

<ExcludeApp ID="Groove" />

<ExcludeApp ID="Lync" />

<ExcludeApp ID="OneDrive" />

<ExcludeApp ID="OneNote" />

<ExcludeApp ID="Outlook" />

<ExcludeApp ID="PowerPoint" />

<ExcludeApp ID="Teams" />

</Product>

</Add>

<Updates Enabled="TRUE" Channel="Monthly" />

<Display Level="None" AcceptEULA="TRUE" />

<Property Name="AUTOACTIVATE" Value="1" />

</Configuration>


Below is my ansible code which looks like. I have the setup.exe and config.xml files available in C drive Office365 folder.

 ---

- hosts: all

  tasks:

  - name: Download Office 365 setup

    win_command: setup.exe /download config.xml

    args:

      chdir: C:\Office365\

 

  - name: Install Office 365 setup

    win_command: setup.exe /configure config.xml

    args:

      chdir: C:\Office365\

 

 Let's run the play for downloading and installing Office

 

 I can see the word got successfully installed in my windows server without any issues.