Is there a way to skip on errors for provisioners?

917 views
Skip to first unread message

Alex Walender

unread,
Aug 25, 2017, 9:39:07 AM8/25/17
to Packer
Hi there,

is there a way to skip provisioner tasks when they fail? Right now the whole build aborts when a provisioner fails.

Alvaro Miranda Aguilera

unread,
Aug 25, 2017, 9:58:40 AM8/25/17
to packe...@googlegroups.com
Packer will stop on exit code.

So you can end your scripts with exit 0 and should work


On Fri, Aug 25, 2017 at 3:39 PM, 'Alex Walender' via Packer <packe...@googlegroups.com> wrote:
Hi there,

is there a way to skip provisioner tasks when they fail? Right now the whole build aborts when a provisioner fails.

--
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/b7453514-ea81-4880-8bc3-e090b38206bd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Alex Walender

unread,
Aug 25, 2017, 10:49:33 AM8/25/17
to Packer
Yeah, this is what I thought, however:

Imagine the following ansible playbook:
---

  - hosts: all
    tasks:
      - include: ansible_playbooks/tester2017-07-25-14-07-45test.yaml
        ignore_errors: yes
      - include: ansible_playbooks/admin2017-07-31-14-28-38test.yaml
        ignore_errors: yes
      - include: ansible_playbooks/admin2017-08-01-15-06-39test.yaml
        ignore_errors: yes

I am skipping faulty playbooks with this. This works as planned when using ansible-playbook alone. The Exit Code is 0. (checked with echo $?).
However, packer still aborts on the first error. I have no experience in golang so I am not able to find our in the source, why this is treated as an error exit.

Rickard von Essen

unread,
Aug 25, 2017, 11:40:22 AM8/25/17
to packe...@googlegroups.com
Attached a run with PACKER_LOG=1 packer build template.json 

--
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.
Reply all
Reply to author
Forward
0 new messages