Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cant disable proxy unexpected EOF #204

Open
Dialgatrainer02 opened this issue Jan 26, 2025 · 1 comment
Open

cant disable proxy unexpected EOF #204

Dialgatrainer02 opened this issue Jan 26, 2025 · 1 comment
Labels

Comments

@Dialgatrainer02
Copy link

When filing a bug, please include the following headings if possible. Any
example text in this template can be deleted.

Overview of the Issue

ansible hangs forever when gathering facts

Reproduction Steps

run packer with the ansible provisioner and try to run a playbook without

gather_facts: false

Plugin and Packer version

packer plugin installed
/home/olivia/.config/packer/plugins/github.com/hashicorp/ansible/packer-plugin-ansible_v1.1.2_x5.0_linux_amd64
/home/olivia/.config/packer/plugins/github.com/hashicorp/lxc/packer-plugin-lxc_v1.0.2_x5.0_linux_amd64

packer version
Packer v1.12.0

Simplified Packer Buildfile

packer {
  required_plugins {
    ansible = {
      source  = "github.com/hashicorp/ansible"
      version = "~> 1"
    }
    lxc = {
      source = "github.com/hashicorp/lxc"
      version = "~> 1"
    }
  }
}


source "lxc" "base" {
  config_file         = "/etc/lxc/default.conf"
  template_name       = "download"
  template_parameters = ["-d", "almalinux", "-a", "amd64", "-r", 9 ]
}

build {
    name = "base"
    sources = ["lxc.base"]

    provisioner "shell" {
        script = "./scripts/ssh.sh"
    }

    provisioner "ansible" {
    ansible_env_vars = ["ANSIBLE_HOST_KEY_CHECKING=False"]
    user = "root"
    playbook_file    = "ansible/base-playbook.yml"
    galaxy_file = "ansible/requirements.yml"
    // use_proxy       = false
    // extra_arguments = [ "-vvvv" ]
  }
}

Operating system and Environment details

host: arch linux
container: alma linux 9
ansible ver: 11.1.0-2 and 10.0.0-1 (both dont work)

Log Fragments and crash.log files

https://gist.github.com/Dialgatrainer02/28f6555c94d6637dccca18a5b3190736

Set the env var PACKER_LOG=1 for maximum log detail.

i tried the solution in #31 but downgrading didn't work
i also tried disabling the proxy but the provisioner fails with unexpected eof is i add the use_proxy line

@Dialgatrainer02
Copy link
Author

Dialgatrainer02 commented Jan 26, 2025

im having the same hanging issue with the package module. no matter where i put the use_proxy = false line it will error

packer log output

2025/01/26 15:32:19 [INFO] (telemetry) Starting provisioner ansible
==> base.lxc.base: Pausing before the next provisioner . Press enter to continue. 
2025/01/26 15:32:23 [DEBUG] - common: receiving ConfigSpec as gob
2025/01/26 15:32:23 packer-plugin-ansible_v1.1.2_x5.0_linux_amd64 plugin: 2025/01/26 15:32:23 ansible-playbook version: 2.18.1
==> base.lxc.base: Provisioning with Ansible...
==> base.lxc.base: Pausing before cleanup of step 'StepWaitInit'. Press enter to continue. 
2025/01/26 15:32:23 packer-plugin-ansible_v1.1.2_x5.0_linux_amd64 plugin: panic: interface conversion: interface {} is nil, not string
2025/01/26 15:32:23 packer-plugin-ansible_v1.1.2_x5.0_linux_amd64 plugin: 
2025/01/26 15:32:23 packer-plugin-ansible_v1.1.2_x5.0_linux_amd64 plugin: goroutine 43 [running]:
2025/01/26 15:32:23 packer-plugin-ansible_v1.1.2_x5.0_linux_amd64 plugin: github.com/hashicorp/packer-plugin-ansible/provisioner/ansible.(*Provisioner).Provision(0xc0000ae000, {0x1b7a460?, 0x0?}, {0x1391fd0, 0xc0009854d0}, {0x138df40, 0xc000740620}, 0xc0003e5860)
2025/01/26 15:32:23 packer-plugin-ansible_v1.1.2_x5.0_linux_amd64 plugin: 	github.com/hashicorp/packer-plugin-ansible/provisioner/ansible/provisioner.go:614 +0xc25
2025/01/26 15:32:23 packer-plugin-ansible_v1.1.2_x5.0_linux_amd64 plugin: github.com/hashicorp/packer-plugin-sdk/rpc.(*ProvisionerServer).Provision(0xc000176340, 0xc0008945d0, 0x1?)
2025/01/26 15:32:23 packer-plugin-ansible_v1.1.2_x5.0_linux_amd64 plugin: 	github.com/hashicorp/packer-plugin-sdk@v0.5.4/rpc/provisioner.go:91 +0x1c9
2025/01/26 15:32:23 packer-plugin-ansible_v1.1.2_x5.0_linux_amd64 plugin: reflect.Value.call({0xc0007463c0?, 0xc00007a660?, 0x13?}, {0x100c7c6, 0x4}, {0xc000566ef8, 0x3, 0x3?})
2025/01/26 15:32:23 packer-plugin-ansible_v1.1.2_x5.0_linux_amd64 plugin: 	reflect/value.go:596 +0xce7
2025/01/26 15:32:23 packer-plugin-ansible_v1.1.2_x5.0_linux_amd64 plugin: reflect.Value.Call({0xc0007463c0?, 0xc00007a660?, 0x7db69668fb30?}, {0xc0007bdef8?, 0x4da845?, 0x7db69668fb00?})
2025/01/26 15:32:23 packer-plugin-ansible_v1.1.2_x5.0_linux_amd64 plugin: 	reflect/value.go:380 +0xb9
2025/01/26 15:32:23 packer-plugin-ansible_v1.1.2_x5.0_linux_amd64 plugin: net/rpc.(*service).call(0xc000176380, 0x0?, 0x0?, 0xc0004d0480, 0xc000560180, 0x0?, {0xe1bac0?, 0xc0008945d0?, 0x8e3367?}, {0xe305a0, ...}, ...)
2025/01/26 15:32:23 packer-plugin-ansible_v1.1.2_x5.0_linux_amd64 plugin: 	net/rpc/server.go:382 +0x211
2025/01/26 15:32:23 packer-plugin-ansible_v1.1.2_x5.0_linux_amd64 plugin: created by net/rpc.(*Server).ServeCodec in goroutine 1
2025/01/26 15:32:23 packer-plugin-ansible_v1.1.2_x5.0_linux_amd64 plugin: 	net/rpc/server.go:479 +0x410
2025/01/26 15:32:23 [INFO] (telemetry) ending ansible
2025/01/26 15:32:23 /home/olivia/.config/packer/plugins/github.com/hashicorp/ansible/packer-plugin-ansible_v1.1.2_x5.0_linux_amd64: plugin process exited
==> base.lxc.base: Pausi

@Dialgatrainer02 Dialgatrainer02 changed the title ansible hangs forever on gathering facts (inc after downgrade) cant disable proxy unexpected EOF Jan 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant