Error saying "Timeout (12s) waiting for privilege escalation prompt: or Connection to closed.\r\n"

0 votes

Packer file contents:

  "provisioners": [{
    "type": "ansible",
    "playbook_file": "../ansible/nexus.yml"

  "builders": [{
    "type": "amazon-ebs",
    "region": "us-east-2",
    "source_ami_filter": {
        "filters": {
            "virtualization-type": "hvm",
            "name": "amzn-ami-hvm*-gp2",
            "root-device-type": "ebs"
        "owners": ["137112412989"],
        "most_recent": true
    "instance_type": "t2.medium",
    "ami_virtualization_type": "hvm",
    "ssh_username": "ec2-user",
    "ami_name": "Nexus (Latest Amazon Linux Base) {{isotime \"2006-01-02T15-04-05-06Z\"| clean_ami_name}}",
    "ami_description": "Nexus AMI",
    "run_tags": {
        "AmiName": "Nexus",
        "AmiCreatedBy": "Packer"
    "tags": {
        "Name": "Nexus",
        "CreatedBy": "Packer"

I end up with this error

Timeout (12s) waiting for privilege escalation prompt: or Connection to closed.\r\n

Feb 9, 2019 in Ansible by Sinha

1 answer to this question.

0 votes

Hey @Sinha, add these parameters in your ansible.config and then try running

forks = 1

ssh_args = -o ControlMaster=no -o ControlPath=none -o ControlPersist=no
pipelining = false
answered Feb 9, 2019 by Monish

Related Questions In Ansible

0 votes
1 answer

Error saying "No handler was ready to authenticate. 1 handlers were checked"

You are mixing underscore and hyphen. cat /etc/ansible/ec2-vars/te ...READ MORE

answered Mar 13, 2019 in Ansible by Kim
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
+2 votes
1 answer
0 votes
1 answer
0 votes
2 answers