i meet problem as followed.
i try to move file using ansible and create ami using packer.
ansible script is....
aaa.yml
---------------------------------------------------
var_a: "file_a.txt"
var_a_path: "/etc/path/file_a.txt"
var_b: "file_b.txt"
var_b_path: "/etc/path/file_b.txt"
---------------------------------------------------
bbb.yml
---------------------------------------------------
- name: copy file
copy:
src: "{{ var_a}}"
dest: "{{ var_a_path}}"
- name: copy file
copy:
src: "{{ var_b}}"
dest: "{{ var_b_path}}"
---------------------------------------------------
.txt is located /roles/ABC/files/file_a.txt
then using packer create ami. then create instance using the ami.
i expect
/etc/path/file_a.txt
/etc/path/file_b.txt
but i got wrong result.
/etc/path/file_a.txt/files/ * ( whole files located in local /roles/ABC/files folder )
/etc/path/file_b.txt/files/ * ( whole files located in local /roles/ABC/files folder )
I have no idea about this.
is there any solution ?