How to use Azure DevOps server TFS Predefined Variable in My Ansible Playbook

0 votes

 want to use Azure DevOps Predefine Variable "$(Build.SourcesDirectory)" in My playbook:

Here is my playbook:

---
- hosts: KBR_MTL361
  tasks:
   - name: copy file
     win_copy:
      src: D:\Web.config
      dest: $(Build.SourcesDirectory)

I am running this ansible-playbook using Azure DevOps Pipeline:

TFS Pipeline Task

But it is not working

Is there anyone who has any idea how to use the variable in the pipeline?

Feb 28, 2022 in DevOps & Agile by Edureka
• 13,690 points
747 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes
Variables make it simple to get important data into different areas of the pipeline. Variables are most commonly used to define a value that you can subsequently use in your pipeline. All variables are changeable strings. The value of a variable in your pipeline can change from job to job or from run to run.

When you define the same variable with the same name in numerous places, the one with the more local scope wins. As a result, a job-level variable can override a stage-level variable. A variable set at the pipeline root level will be overridden by a variable set at the stage level. A variable that is set at the root of the pipeline.
answered Mar 2, 2022 by Edureka
• 13,690 points

edited Mar 5

Related Questions In DevOps & Agile

+13 votes
2 answers
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
0 answers

how to use azure devOps?

What is azure DevOps and how do ...READ MORE

Dec 20, 2022 in DevOps & Agile by Edureka
• 13,620 points
525 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,248 views
0 votes
1 answer
0 votes
2 answers

ansible-command not found

Use some other variable instead of PATH. READ MORE

answered Apr 23, 2019 in Ansible by Vismaya
11,091 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP