Hi,
the way I understand it you want your Playbook to only copy the license.properties file to the location in `author_folder` if the tag `aem_author` is specified und to the location `publishe_folder` when the playbook is invoked with the `aem_publish` tag?
If this is the case then I think the most common way would be to always copy to the location specified in a variable `dest_folder` which is set per host or group in your inventory.
If for some reason you have to be able to set it via tags, than I would probably would use `set_fact` in combination with tags to specify the variable content accordingly:
- name: Set destination for Author
set_fact:
dest_folder:
"{{ author_folder }}"
tags:
- aem_author
- name: Set destination for Publisher
set_fact:
dest_folder: "{{ publishe_folder }}"
tags:
- aem_publish
- name: Copy License file on Author
copy:
src: license.properties
dest: "{{ dest_folder }}"
owner: cq5
group: cq5
mode: 755
force: yes
tags:
- aem_author
- aem_publish
This would probably work but I feel that this really the wrong way to do it unless you have a really specific need.
Cheers,
André