Hi
I am having an issue in installing an application using ansible automation. I tried to deploy an application from ansible server to the windows virtual machine in the same vnet. I tried to install git.exe and notepad++.exe files into the windows virtual machine using ansibleplaybooks.when i run the command " ansible-playbook -i /home/ansibleuser01/ansibleplaybooks/inventory/inventory.yml /home/ansibleuser01/ansibleplaybooks/noteapp.yml.
It creates a VM, It creates a folder named software, downloads the .exe zip file into the folder. It unzips the file and the below screen appears and it stops(as shown in the attachment). The code is as shared below.
- name: Installing .NET Framework 4.8
win_package:
path: “https://go.microsoft.com/fwlink/?LinkId=2085155”
product_id: none
state: present
arguments: /q - pause: seconds=150
- name: Installing IIS features
win_optional_feature:
name: - IIS-WebServerRole
- IIS-WebServer
- IIS-CommonHttpFeatures
- IIS-DefaultDocument
- IIS-DirectoryBrowsing
- IIS-HttpErrors
- IIS-StaticContent
- IIS-HealthAndDiagnostics
- IIS-HttpLogging
- IIS-Performance
- IIS-HttpCompressionStatic
- IIS-Security
- IIS-RequestFiltering
- IIS-ApplicationDevelopment
- IIS-WebSockets
- IIS-WebServerManagementTools
- IIS-ManagementConsole
state: present - name: Craeting a Folder to Download the applications
win_shell: mkdir C:\softwares
args:
executable: cmd.exe - name: Downloading Git-2.28.0-64-bit.zip file
win_get_url:
url: “https://hilmah001.blob.core.windows.net/myapps/Git-2.28.0-64-bit.zip”
dest: ‘C:\softwares\Git-2.28.0-64-bit.zip’ - name: Unzip Git-2.28.0-64-bit.zip file
win_shell: tar -xvf Git-2.28.0-64-bit.zip
args:
executable: cmd.exe
chdir: C:\softwares - name: grant the ansible user the SeTcbPrivilege right
win_user_right:
name: SeTcbPrivilege
users: ansibleadmin
action: add - name: Install Git
win_package:
path: C:\softwares\Git-2.28.0-64-bit.exe
product_id: none
arguments: - /install
- /passive
- /norestart
- name: Downloading Installer.zip file
win_get_url:
url: “https://hilmah001.blob.core.windows.net/myapps/Installer.zip”
dest: ‘C:\softwares\Installer.zip’ - name: Unzip Installer.zip file
win_shell: tar -xvf Installer.zip
args:
executable: cmd.exe
chdir: C:\softwares - name: Install Notepad++
win_package:
path: C:\softwares\npp.7.7.1.Installer.x64.exe
product_id: none
arguments: - /install
- /passive
- /norestart
- name: Installing .NET Hosting 3.1.2 Bundle
win_package:
path: “https://download.visualstudio.microsoft.com/download/pr/dd119832-dc46-4ccf-bc12-69e7bfa61b18/990843c6e0cbd97f9df68c94f6de6bb6/dotnet-hosting-3.1.2-win.exe”
product_id: none
state: present
arguments: /q /norestart - name: Stop Windows themes services, if started
win_service:
name: Themes
state: stopped - name: Disable Windows themes services
win_command: powershell.exe -
args:
stdin: Set-Service -Name Themes -StartupType Disabled - name: Stop Windows Update services, if started
win_service:
name: wuauserv
state: stopped - name: Disable Windows Update services
win_command: powershell.exe -
args:
stdin: Set-Service -Name wuauserv -StartupType Disabled
I think it needs some admin rights to install the application. Please advice what to do.