packer change ansible script as not expected

17 views
Skip to first unread message

Hyeongseob Kim

unread,
Feb 16, 2017, 8:11:46 AM2/16/17
to Packer
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 ? 

Alvaro Miranda Aguilera

unread,
Feb 16, 2017, 3:40:24 PM2/16/17
to packe...@googlegroups.com
hello

can you share a git repo of all this? template plus scripts?

That way will be easier to review and run

Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/23a68489-eb5e-404a-934c-f284d8bd8c92%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Reply all
Reply to author
Forward
0 new messages