16th May 2021

Playbook to run the ansible task after successful execution of before ansible task in windows

I'm executing the below YAML(ansible) file using Jenkins.

I want to execute the task2 only after the successful execution of task1, My YAML file is as below.

How do I add the dependency for this?

Requesting help on this

For example:


-name: task1

 win_command: "C:\Windows\Microsoft.NET\FRAMEWORK\V3.9.3013\MSBuild.exe" "E:\ApplicationFolder\App.xml" -target:Execute /p:ApplicationName="appname"

 register: executeapp1


   - execute-app1

-name: task2

 win_command: "C:\Windows\Microsoft.NET\FRAMEWORK\V3.9.3013\MSBuild.exe" "E:\ApplicationFolder\App.xml" -target:Execute /p:ApplicationName="appname1"

 register: executeapp2


   - execute-app2

Write your answer


Speak with a Learning Advisor

Understand how the industry and practically oriented courses at Mindmajix transform your career.

  • Explore the trending and niche courses and learning maps
  • Learn about tuition fee, payment plans, and scholarships
  • Get access to webinars and self-paced learning videos