You can use host vars or group vars like the following.
In the root of your ansible repo where your inventory file sits create the following yaml files for host vars
host_vars/hosta
host_vars/hostb
Within these files you can now specify variables e.g within host_vars/hosta
file_path: /file/path/for/hosta
And then create file host_vars/hostb
file_path: /file/path/for/hostb
Within your playbook you can now specify
copy: src=jboss.sh dest="{{ file_path }}" mode=u+rwx
This will use the variable from within your host_vars file, its the same for group vars only the folder is called group_vars and you would instead use the group names instead of the host names.
Kind Regards