But that just it, the 'to upload directory gets created in the 'shell-local' provisioner, not before running packer. If you have to create the 'to upload' directory before running packer, what's the point of the 'mkdir -p to upload in the 'shell-local' provisioner ?
On Tue, Aug 15, 2017 at 1:22 PM, Rickard von Essen < [email protected]> wrote: > Don't have a computer right now... But I guess it fails on "packer > validate", packer requires that you have have all source files/dirs in the > file privisioner before building. But the example you give should work if > you create the "toupload" dir before you run packer. > > On Aug 15, 2017 20:04, "Chad Willman" <[email protected]> wrote: > >> Yes, I've read the documentation. But the fact is that this JSON excerpt >> below from the packer docs does not work - https://www.packer.io/docs/p >> rovisioners/file.html >> >> The 'file' provisioner ignores the fact that its source directive is >> being created by the 'shell-local' directive. Packer fails this JSON >> config, as is, unmodified. >> >> >> >> { >> "provisioners": [ >> { >> "type": "shell-local", >> "command": "mkdir -p toupload; tar cf toupload/files.tar files" >> }, >> { >> "destination": "/tmp/", >> "source": "./toupload", >> "type": "file" >> }, >> { >> "inline": [ >> "cd /tmp && tar xf toupload/files.tar", >> "rm toupload/files.tar" >> ], >> "type": "shell" >> } >> ]} >> >> >> On Tue, Aug 15, 2017 at 11:44 AM, Rickard von Essen < >> [email protected]> wrote: >> >>> The provisioners section should be a list and will execute in order. Can >>> you attach the template you try to use? >>> >>> On Aug 15, 2017 17:07, "Chad Willman" <[email protected]> wrote: >>> >>>> >>>> I'm seeing a problem where packer is trying to execute a 'file' >>>> provisioner step, before it executes the 'shell-local' provisioner step >>>> that creates the file. >>>> Even after converting my provisioner list to match the example on this >>>> page - https://www.packer.io/docs/provisioners/file.html, packer >>>> always tries to >>>> execute the 'file' step before ever executing the 'shell-local' step. >>>> >>>> I've not found any help in documentation or other groups on line, so if >>>> there's a place I should be posting this question, please let me know. >>>> >>>> Any other help is appreciated. >>>> >>>> CW >>>> >>>> -- >>>> 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 [email protected]. >>>> To view this discussion on the web visit https://groups.google.com/d/ms >>>> gid/packer-tool/0a639276-6783-47b2-b7c1-d4878c81d4d3%40googlegroups.com >>>> <https://groups.google.com/d/msgid/packer-tool/0a639276-6783-47b2-b7c1-d4878c81d4d3%40googlegroups.com?utm_medium=email&utm_source=footer> >>>> . >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> -- >>> 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 a topic in the >>> Google Groups "Packer" group. >>> To unsubscribe from this topic, visit https://groups.google.com/d/to >>> pic/packer-tool/LudHDo1QZ7U/unsubscribe. >>> To unsubscribe from this group and all its topics, send an email to >>> [email protected]. >>> To view this discussion on the web visit https://groups.google.com/d/ms >>> gid/packer-tool/CALz9Rt-OfGLFWGsZJbnqK01GisvfzCyM2LwZ1Xk%3Dx >>> 5UZBPfqYA%40mail.gmail.com >>> <https://groups.google.com/d/msgid/packer-tool/CALz9Rt-OfGLFWGsZJbnqK01GisvfzCyM2LwZ1Xk%3Dx5UZBPfqYA%40mail.gmail.com?utm_medium=email&utm_source=footer> >>> . >>> >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- >> 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 [email protected]. >> To view this discussion on the web visit https://groups.google.com/d/ms >> gid/packer-tool/CACbRiuxpJK2fXAqsWUvDfLOvAKC77U0CLcWq% >> 2BLECAA8xfqJPyw%40mail.gmail.com >> <https://groups.google.com/d/msgid/packer-tool/CACbRiuxpJK2fXAqsWUvDfLOvAKC77U0CLcWq%2BLECAA8xfqJPyw%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > -- > 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 a topic in the > Google Groups "Packer" group. > To unsubscribe from this topic, visit https://groups.google.com/d/ > topic/packer-tool/LudHDo1QZ7U/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/packer-tool/CALz9Rt9P6HxXW%2BbFgnGvW_A%2BvdqC2-QZLvcxpmLR1PC9J7QEsA% > 40mail.gmail.com > <https://groups.google.com/d/msgid/packer-tool/CALz9Rt9P6HxXW%2BbFgnGvW_A%2BvdqC2-QZLvcxpmLR1PC9J7QEsA%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/CACbRiuz6-UGRiGZ%2BhGpf5R%2BTZw29Ah5YS-oHYcrHtCcGjn0O5A%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
