Hi,

  I have a packer template written about 9 months ago on a previous Packer 
version (v0.7, that worked fine) that isn't working with Packer 1.1.0 - it 
is erroring on the scp upload of the puppet modules files.

It's a really basic template to build a custom AWS AMI using the 
puppet-masterless provisioner. Here is the template:

{
    "variables": {
        "aws_access_key": "",
        "aws_secret_key": ""
    },


    "provisioners": [
        {
            "type": "shell",
            "script": "install_puppet.sh"
        },
        {
            "type": "puppet-masterless",
            "manifest_file": "puppet/manifests/site.pp",
            "module_paths": [ "puppet/modules" ]
        }
    ],


    "builders": [
        {
            "type": "amazon-ebs",
            "access_key": "{{user `aws_access_key`}}",
            "secret_key": "{{user `aws_secret_key`}}",
            "region": "eu-west-1",
            "source_ami": "ami-ebd02392",
            "instance_type": "t2.micro",
            "ssh_username": "ec2-user",
            "ami_name": "basic-webserver-{{timestamp}}"
        }
    ]
}


The source AMI is the latest AWS Linux AMI for my region. The puppet module 
simply installs NGINX with some basic config and a simple webpage.

The relevant section of the error log is as follows:

2017/09/19 09:40:31 ui:     amazon-ebs: Uploading local modules from: ./
puppet/modules/
    amazon-ebs: Uploading local modules from: ./puppet/modules/
2017/09/19 09:40:31 ui:     amazon-ebs: Creating directory: /tmp/packer-
puppet-masterless/module-0
    amazon-ebs: Creating directory: /tmp/packer-puppet-masterless/module-0
2017/09/19 09:40:31 packer: 2017/09/19 09:40:31 opening new ssh session
2017/09/19 09:40:31 packer: 2017/09/19 09:40:31 starting remote command: 
sudo mkdir -p '/tmp/packer-puppet-masterless/module-0'
2017/09/19 09:40:31 packer: 2017/09/19 09:40:31 [INFO] RPC endpoint: 
Communicator ended with: 0
2017/09/19 09:40:31 [INFO] 0 bytes written for 'stdout'
2017/09/19 09:40:31 [INFO] 0 bytes written for 'stderr'
2017/09/19 09:40:31 [INFO] RPC client: Communicator ended with: 0
2017/09/19 09:40:31 [INFO] RPC endpoint: Communicator ended with: 0
2017/09/19 09:40:31 packer: 2017/09/19 09:40:31 [INFO] 0 bytes written for 
'stdout'
2017/09/19 09:40:31 packer: 2017/09/19 09:40:31 [INFO] 0 bytes written for 
'stderr'
2017/09/19 09:40:31 packer: 2017/09/19 09:40:31 [INFO] RPC client: 
Communicator ended with: 0
2017/09/19 09:40:31 packer: 2017/09/19 09:40:31 Upload dir 'puppet/modules/' 
to '/tmp/packer-puppet-masterless/module-0'
2017/09/19 09:40:31 packer: 2017/09/19 09:40:31 opening new ssh session
2017/09/19 09:40:32 packer: 2017/09/19 09:40:32 Starting remote scp process: 
 scp -rvt /tmp/packer-puppet-masterless/module-0
2017/09/19 09:40:32 packer: 2017/09/19 09:40:32 Started SCP session, 
beginning transfers...
2017/09/19 09:40:32 packer: 2017/09/19 09:40:32 SCP: starting directory 
upload: nginx
2017/09/19 09:40:32 packer: 2017/09/19 09:40:32 SCP: starting directory 
upload: files
2017/09/19 09:40:32 [INFO] (telemetry) ending puppet-masterless
2017/09/19 09:40:32 [INFO] (telemetry) found error: Error uploading modules: 
scp: /tmp/packer-puppet-masterless/module-0/nginx: Permission denied


I've tried setting *module_paths* to various combinations but it seems to 
make no difference:


   - [ "puppet/modules" ]
   - [ "./puppet/modules" ]
   - [ "puppet/modules/" ]

 
 I've also tried setting manually creating the 
*/tmp/packer-puppet-masterless* directory in my shell provisioner, and 
setting explicit directory permissions, but again this makes no difference. 
Of course Packer is creating the *module-0* subdirectory.

Any ideas please, or is this a known defect?

Many thanks,

  Chris

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/12dd1681-ecde-4c4d-bdb1-e8b9396facd0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to