I have a tasks file inside a role where I want to copy some OS and Arch dependent package - 2 conditionals.
The issue I’m struggling with is to assign the right source file name to the task.
The task:
name: Copy the relevant pkg to /var/tmp
copy: src=my_repo/{{ pkg _name }} dest=/var/tmp/
Now per OS/Arch I need to get the right name of the package
I have different packages for Linux x86 and x86_64 for example, same for Solaris sparc and x86…
I created a var/ main.yml file and thought populating it the the correct file name assignment
It sounds like you simply need to specify the system facts as the src name. For example, src=my_repo/{{ansible_system}}/{{ansible_architecture}}/{{pkg_name}}, which would work assuming you have your files organized as: