hashicorp / packer-plugin-ansible

Packer plugin for Ansible Provisioner
https://www.packer.io/docs/provisioners/ansible
Mozilla Public License 2.0
49 stars 35 forks source link

Only see stdout on Errors #187

Closed shanep2300 closed 5 months ago

shanep2300 commented 6 months ago

Hello,

Running Packer through Jenkins (not sure if this is a Jenkins issue or Packer/Ansible config).

Jenkins console will get to the packer build step, print that line, and then I get nothing until the ansible scripts either completes or throws an error. If it's successful, I don't see any of the ansible output. But if there is an error I see the normal ansible output up until the error in one fell swoop.

I would like to see the ansible steps being printed out in the Jenkins console ouput as they're happening.

ansible.cfg

[defaults]
stdout_callback = yaml

main.pkr.hcl

provisioner "ansible" {
    ansible_env_vars = ["ANSIBLE_CONFIG=ansible.cfg"]
    extra_arguments  = ["--extra-vars", "ansible_winrm_server_cert_validation=ignore"]
    playbook_file    = "win-base-custom-harden.yml"
    use_proxy        = false
    user             = "g-admin"
  }
lbajolet-hashicorp commented 5 months ago

Hi @shanep2300,

Not sure how we can help, but you should try running your build with verbose logs (set the PACKER_LOG=1 environment variable for that) for more debugging information, this may point you to the source of the problem.

That said, this doesn't appear to be a bug or a feature request, and issues like those are mostly what that repo's for. For general usage questions I would suggest using our discuss forum for that, as the community may be able to help with your question/problem.

I'll close this issue now, but please feel free to reopen if you think I've been too quick to jump the gun here.

Thanks!