When we hard code "src" to app1.conf.j2 its working for app1.
Please let us know is it possible with this method? We are having around 20
apps and whats the best method to simplify the ansible playbook to specify
only the variable.
TASK [test : Copy app1 file to /opt/conf.d/ Directory] *****************************************************************************************************************
fatal: [target1]: FAILED! => {“changed”: false, “msg”: “Could not find or access ‘app1.conf.j2’\nSearched in:\n\t/mnt/d/Ansible/apache-playbook/roles/test/templates/app1.conf.j2\n\t/mnt/d/Ansible/apache-playbook/roles/test/app1.conf.j2\n\t/mnt/d/Ansible/apache-playbook/roles/test/tasks/templates/app1.conf.j2\n\t/mnt/d/Ansible/apache-playbook/roles/test/tasks/app1.conf.j2\n\t/mnt/d/Ansible/apache-playbook/templates/app1.conf.j2\n\t/mnt/d/Ansible/apache-playbook/app1.conf.j2 on the Ansible Controller.\nIf you are using a module and expect the file to exist on the remote, see the remote_src option”}
TASK [test : Copy app1 file to /opt/conf.d/ Directory]
*****************************************************************************************************************
fatal: [target1]: FAILED! => {"changed": false, "msg": "Could not find or access 'app1.conf.j2'\nSearched
in:\n\t/mnt/d/Ansible/apache-playbook/roles/test/templates/app1.conf.j2\n\t/mnt/d/Ansible/apache-playbook/roles/test/app1.conf.j2\n\t/mnt/d/Ansible/apache-playbook/roles/test/tasks/templates/app1.conf.j2\n\t/mnt/d/Ansible/apache-playbook/roles/test/tasks/app1.conf.j2\n\t/mnt/d/Ansible/apache-playbook/templates/app1.conf.j2\n\t/mnt/d/Ansible/apache-playbook/app1.conf.j2
on the Ansible Controller.\nIf you are using a module and expect the file to exist on the remote, see the remote_src
option"}