{ "variables": { "project": "gcp-project", "image_family": "centos-7", "username": "centos", "sftp_username": "", "sftp_password":"", "zone": "us-central1-c", "version": "latest" },
"builders": [ { "type": "googlecompute", "account_file": "account.json", "project_id": "{{user `project`}}", "zone": "{{user `zone`}}", "source_image":"centos-7-v20171025", "image_name": "sftp-{{user `image_family`}}-{{user `version`}}-{{timestamp}}", "image_family": "{{user `image_family`}}", "image_description": "sftp - from packer", "ssh_username": "{{user `username`}}", "machine_type": "g1-small" } ],
"provisioners": [ { "type" : "shell", "inline": [ "sudo adduser {{user `sftp_username`}}", "sudo echo -e '{{user `sftp_password`}}\n{{user `sftp_password`}}\n' | sudo passwd {{user `sftp_username`}}", "sudo mkdir -p /var/sftp/upload", "sudo chown root:root /var/sftp", "sudo chmod 755 /var/sftp", "sudo chown {{user `sftp_username`}}:{{user `sftp_username`}} /var/sftp/upload" ] }, { "type": "shell-local", "command": "rake spec TARGET_HOST=remotehost" } ]}host = ENV['TARGET_HOST']
options = Net::SSH::Config.for(host)
options[:user] = 'centos'
set :host, options[:host_name] || hostset :ssh_options, optionsNet::SSH::AuthenticationFailed: Authentication failed for user cen...@35.193.23.13 ==> googlecompute: Checking image does not exist...==> googlecompute: Creating temporary SSH key for instance...==> googlecompute: Using image: centos-7-v20171025==> googlecompute: Creating instance... googlecompute: Loading zone: us-central1-c googlecompute: Loading machine type: g1-small googlecompute: Loading network: default googlecompute: Requesting instance creation... googlecompute: Waiting for creation operation to complete... googlecompute: Instance has been created!==> googlecompute: Waiting for the instance to become running... googlecompute: IP: 1.2.3.4==> googlecompute: Waiting for SSH to become available...==> googlecompute: Connected to SSH!==> googlecompute: Provisioning with shell script: /var/folders/vh/03_qyfy91r757mypx3qcgjfh0000gn/T/packer-shell043898698 googlecompute: New password: BAD PASSWORD: The password contains the user name in some form googlecompute: Changing password for user nifi. googlecompute: passwd: all authentication tokens updated successfully. googlecompute: Retype new password:==> googlecompute: Executing local command: rake spec TARGET_HOST=host googlecompute: googlecompute: An error occurred while loading ./spec/31.2.3.4/sftp_spec.rb. googlecompute: On host `1.2.3.4' googlecompute: Failure/Error: googlecompute: describe service('sshd'), :if => os[:family] == 'redhat' do googlecompute: it { should be_enabled } googlecompute: it { should be_running } googlecompute: end googlecompute: Net::SSH::AuthenticationFailed: googlecompute: Authentication failed for user cen...@35.193.23.13--
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 packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/837f40a5-1759-4d39-a2b0-dd61940a78bc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.