Error on an ansible provisioner (Error uploading script: Process exited with: 1. Reason was: ())

312 views
Skip to first unread message

Jean-Philippe M

unread,
Feb 10, 2016, 3:45:58 PM2/10/16
to Packer
Greetings,

I have been trying out packer to automatically create images with the required software installed. I'm trying out the ansible provisioner and wrote it down as such :

{
    "provisioners": [
      {
        "type": "shell",
        "inline": [
            "yum install epel-release",
            "yum install ansible"
        ]
    },
    {
        "type": "ansible-local",
        "playbook_file": "/usr/local/imagecreation/images/centos7-wordpress.yml",
        "playbook_dir": "/usr/local/imagecreation/images",
        "inventory_groups" : "images"
    }
]

So I install the epel repository first, then I install ansible. After I run the ansible playbook. However, I am getting the following error :

Error uploading script: Process exited with: 1. Reason was:  ()

It's not clear what script it's talking about. Is it the ansible files? But then again, is there a way I could know why this failed?

Alvaro Miranda Aguilera

unread,
Feb 12, 2016, 4:31:17 AM2/12/16
to packe...@googlegroups.com

On Thu, Feb 11, 2016 at 9:45 AM, Jean-Philippe M <redcav...@gmail.com> wrote:
            "yum install epel-release",
            "yum install ansible"

Hello,

You can run the commands by hand to proof-read they are doing fine.

Without seeing your ansible, I think this should be modified:

from:

            "yum install epel-release",
            "yum install ansible"

to

            "yum install -y epel-release",
            "yum install -y ansible"

If you only require a WP install, you can use an script like this:



Thanks
Alvaro.

Jean-Philippe M

unread,
Feb 16, 2016, 10:36:13 AM2/16/16
to Packer
Hi,

I'm thinking the issue may not be in the provisioner themselves. I've tried running it again with

            "yum install -y epel-release",
            "yum install -y ansible"

and the error was the same. I'm thinking packer is unable to upload the script onto the VM and execute it, for some reason. I'm using a minimal centos 7 to test this out.

Jean-Philippe M

unread,
Feb 16, 2016, 1:52:53 PM2/16/16
to Packer
I've found packer logs in /tmp on the origin server. Here's the logs:

              2016/02/16 13:22:52 packer-builder-openstack: 2016/02/16 13:22:52 opening new ssh session
              2016/02/16 13:22:52 packer-builder-openstack: 2016/02/16 13:22:52 Starting remote scp process:  scp -vt /root
              2016/02/16 13:22:52 packer-builder-openstack: 2016/02/16 13:22:52 Started SCP session, beginning transfers...
              2016/02/16 13:22:52 packer-builder-openstack: 2016/02/16 13:22:52 Copying input data into temporary file so we can read the length
              2016/02/16 13:22:52 packer-builder-openstack: 2016/02/16 13:22:52 [DEBUG] Uploading script_nnn.sh: perms=C0644 size=64
              2016/02/16 13:22:52 packer-builder-openstack: 2016/02/16 13:22:52 SCP session complete, closing stdin pipe.
              2016/02/16 13:22:52 packer-builder-openstack: 2016/02/16 13:22:52 Waiting for SSH session to complete.
              2016/02/16 13:22:52 packer-builder-openstack: 2016/02/16 13:22:52 non-zero exit status: 1

The same messages come back in loop until it times out. I'm trying to upload it in /root here, but I tried to upload to /tmp earlier and it did not work either.

Jean-Philippe M

unread,
Feb 16, 2016, 4:05:29 PM2/16/16
to Packer
After some more research, I did manage to get the shell provisioner to work once. However, it looks like it was a fluke. Any further attempts afterward result in failure. Hence, I'm thinking that packer is only able to upload its file right when the ssh service starts. It may be a ssh configuration that is causing me this problem..
Reply all
Reply to author
Forward
0 new messages