packer-plugin-ansible icon indicating copy to clipboard operation
packer-plugin-ansible copied to clipboard

Only see stdout on Errors

Open shanep2300 opened this issue 1 year ago • 0 comments

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"
  }

shanep2300 avatar May 06 '24 16:05 shanep2300