I want to make or join path in Ansible. When I was running below code then I am getting an error.
Code:
---
- name: Project1
hosts: target_hosts
vars:
Data: '{{get_data}}' #input from user
src_inst: '{{get_inst}}' #input from user
tasks:
- name: set path
set_fact:
main_path : '{{ ("\\abc.de.net\xyz\\mn\", src_inst, "\temp") | path_join }}'
when: Data == 'qaz'
Error:
Unexcepted failure during module execution.
If user give input Data = 'qaz' and src_inst = 'w_123'
Desired Output:
main_path = "\\abc.de.net\xyz\\mn\w_123\temp"
Do you know how to solve this error or how to join path?