Re: [packer] user: could not determine current user from environment.?

2018-04-04 Thread Matthew Hooker
For some reason, Packer couldn't identify the user from the environment.
This may already be solved if you use a newer version of Packer, but
otherwise the solution is to add "user": "" to the ansible
provisioner, where  is the ansible_user you want to use. We don't
recommend running packer as root.

Thanks,
--Matt Hooker

On Wed, Apr 4, 2018 at 3:09 PM test  wrote:

> hi , i am trying to a gitlab-ci build using docker container
>
>  ubuntu:latest
>
> i have installed packer and when i try to execute packer build command i
> am getting an error. please help me solve this error.
>
> My image.json file
>
> {
>   "variables": {
>   },
>   "builders": [{
> "type": "amazon-ebs",
> "instance_type": "t2.large",
> "region": "us-east-1",
> "source_ami": "ami-d15a75c7",
> "security_group_id": "x",
> "subnet_id": "x",
> "ami_name": "gitlab-runner-as_ubuntu_docker_{{timestamp}}",
> "ssh_username": "ubuntu",
> "ssh_pty": true,
> "ssh_private_ip": true,
> "associate_public_ip_address": false,
> "shutdown_behavior": "stop",
> "ena_support": true
>   }],
>   "provisioners": [
> {
>   "type": "shell",
>   "inline": [
> "sudo apt-get -y update",
> "sudo apt-get install -y python-simplejson",
> "sudo apt-get install -y python-requests",
> "sudo apt-get install -y python-requests",
> "sudo apt-get install python-pip -y"
> ]
>  },
>  {
>   "type": "ansible",
>   "playbook_file":
> "/builds/infra/packer-role-gitlab-runner-autoscaling/playbook.yml",
>   "ansible_env_vars": [
> "ANSIBLE_HOST_KEY_CHECKING=False",
> "ANSIBLE_REMOTE_TMP=/tmp/ansible",
> "ANSIBLE_ASK_SUDO_PASS=False",
> "ANSIBLE_REMOTE_USER=ubuntu",
> "ANSIBLE_USER_PYTHON=/usr/bin/python3",
> "PYTHONPATH=/usr/local/bin/python2.7/site-packages",
> "REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt"
>   ]
> },
>  {
>   "type": "shell",
>   "script":
> "/builds/infra/packer-role-gitlab-runner-autoscaling/script.sh"
>  }
>   ]
> }
>
>
>
> $ packer -version
> 1.1.2
> $ whoami
> root
> $ packer_log=1 packer build image.json
> amazon-ebs output will be in this color.
>
> 1 error(s) occurred:
>
> * user: could not determine current user from environment.
> ERROR: Job failed: exit code 1
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/c8a99ded-231d-4ba6-8170-f7e7e3f19764%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CAEpfdnx7xmqpnnCJ89A6xUzodkFdbCG5v_LZZT8UeUU0mziJeg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[packer] user: could not determine current user from environment.?

2018-04-04 Thread test
hi , i am trying to a gitlab-ci build using docker container

 ubuntu:latest 

i have installed packer and when i try to execute packer build command i am 
getting an error. please help me solve this error.

My image.json file

{
  "variables": {
  },
  "builders": [{
"type": "amazon-ebs",
"instance_type": "t2.large",
"region": "us-east-1",
"source_ami": "ami-d15a75c7",
"security_group_id": "x",
"subnet_id": "x",
"ami_name": "gitlab-runner-as_ubuntu_docker_{{timestamp}}",
"ssh_username": "ubuntu",
"ssh_pty": true,
"ssh_private_ip": true,
"associate_public_ip_address": false,
"shutdown_behavior": "stop",
"ena_support": true
  }],
  "provisioners": [
{
  "type": "shell",
  "inline": [
"sudo apt-get -y update",
"sudo apt-get install -y python-simplejson",
"sudo apt-get install -y python-requests",
"sudo apt-get install -y python-requests",
"sudo apt-get install python-pip -y"
]
 },
 {
  "type": "ansible",
  "playbook_file": 
"/builds/infra/packer-role-gitlab-runner-autoscaling/playbook.yml",
  "ansible_env_vars": [
"ANSIBLE_HOST_KEY_CHECKING=False",
"ANSIBLE_REMOTE_TMP=/tmp/ansible",
"ANSIBLE_ASK_SUDO_PASS=False",
"ANSIBLE_REMOTE_USER=ubuntu",
"ANSIBLE_USER_PYTHON=/usr/bin/python3",
"PYTHONPATH=/usr/local/bin/python2.7/site-packages",
"REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt"
  ]
},
 {
  "type": "shell",
  "script": 
"/builds/infra/packer-role-gitlab-runner-autoscaling/script.sh"
 }
  ]
}



$ packer -version
1.1.2
$ whoami
root
$ packer_log=1 packer build image.json
amazon-ebs output will be in this color.

1 error(s) occurred:

* user: could not determine current user from environment.
ERROR: Job failed: exit code 1

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/c8a99ded-231d-4ba6-8170-f7e7e3f19764%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[packer] Windows Defender False Positives

2018-04-04 Thread Matthew Hooker
Hi Everyone,

A recent release of Packer has been triggering Windows Defender, which is
telling users that Packer contains a trojan. We've been in touch with
Microsoft through the Windows Defender Security Intelligence program, and
we can confirm this is a false positive. Updating your definitions version
should prevent Windows Defender from identifying packer as malware. More
information can be found on this github issue:
https://github.com/hashicorp/packer/issues/6093#issuecomment-378708069

We are working with Microsoft to identify ways we can prevent this from
happening in the future.

If you have any questions, please feel free to reach out.

Thanks,
--Matt Hooker

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CAEpfdnzwVAegAEtUjbGJSrFodj8UOnziaGgE0xHd2Q0_4x0GUQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [packer] Re: MSSQL Image with Packer

2018-04-04 Thread Alvaro Miranda Aguilera
Hi there,

What about you open an issue and send a PR. ?

Alvaro.


On Wed, Apr 4, 2018 at 2:16 PM, Kris 
wrote:

> I was on version 1.2.1, but upgraded to 1.2.2 this morning and have the
> same issue.
>
> I did find the root cause though.  In the driver_gce.go there is a
> function that lists the projects to search, windows-sql-cloud is not one of
> the projects.
>
>
>
> *func (d *driverGCE) GetImage(name string, fromFamily bool) (*Image,
> error) {*
> * projects := []string{d.projectId, "centos-cloud", "coreos-cloud",
> "cos-cloud", "debian-cloud", "google-containers", "opensuse-cloud",
> "rhel-cloud", "suse-cloud", "ubuntu-os-cloud", "windows-cloud", "gce-nvme"}*
> * var errs error*
> * for _, project := range projects {*
> * image, err := d.GetImageFromProject(project, name, fromFamily)*
> * if err != nil {*
> * errs = packer.MultiErrorAppend(errs, err)*
> * }*
> * if image != nil {*
> * return image, nil*
> * }*
> * }*
>
>
> On Tuesday, April 3, 2018 at 1:42:30 PM UTC-4, Kris wrote:
>>
>> I am attempting to build a custom image for SQL server, using
>> the sql-std-2016-win-2016 family in the projects/windows-sql-cloud .  I get
>> the error messages below, is this because packer does not know about the
>> projects/windows-sql-cloud?
>>
>> * googleapi: Error 404: The resource 'projects/centos-cloud/global/
>> images/family/sql-std-2016-win-2016' was not found, notFound
>> * googleapi: Error 404: The resource 'projects/coreos-cloud/global/
>> images/family/sql-std-2016-win-2016' was not found, notFound
>> * googleapi: Error 404: The resource 'projects/cos-cloud/global/ima
>> ges/family/sql-std-2016-win-2016' was not found, notFound
>> * googleapi: Error 404: The resource 'projects/debian-cloud/global/
>> images/family/sql-std-2016-win-2016' was not found, notFound
>> * googleapi: Error 404: The resource 'projects/google-containers/gl
>> obal/images/family/sql-std-2016-win-2016' was not found, notFound
>> * googleapi: Error 404: The resource 'projects/opensuse-cloud/globa
>> l/images/family/sql-std-2016-win-2016' was not found, notFound
>> * googleapi: Error 404: The resource 'projects/rhel-cloud/global/im
>> ages/family/sql-std-2016-win-2016' was not found, notFound
>> * googleapi: Error 404: The resource 'projects/suse-cloud/global/im
>> ages/family/sql-std-2016-win-2016' was not found, notFound
>> * googleapi: Error 404: The resource 'projects/ubuntu-os-cloud/glob
>> al/images/family/sql-std-2016-win-2016' was not found, notFound
>> * googleapi: Error 404: The resource 'projects/windows-cloud/global
>> /images/family/sql-std-2016-win-2016' was not found, notFound
>> * googleapi: Error 404: The resource 'projects/gce-nvme/global/imag
>> es/family/sql-std-2016-win-2016' was not found, notFound
>>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/packer-tool/eafd28b2-997e-4525-85b7-19812792240e%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Alvaro

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CAHqq0ey-4_3cRykPejrpvN0B8gffSUcAcUYe4hUhvRSxt3PbaA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[packer] Re: MSSQL Image with Packer

2018-04-04 Thread Kris
I was on version 1.2.1, but upgraded to 1.2.2 this morning and have the 
same issue.

I did find the root cause though.  In the driver_gce.go there is a function 
that lists the projects to search, windows-sql-cloud is not one of the 
projects.



*func (d *driverGCE) GetImage(name string, fromFamily bool) (*Image, error) 
{*
* projects := []string{d.projectId, "centos-cloud", "coreos-cloud", 
"cos-cloud", "debian-cloud", "google-containers", "opensuse-cloud", 
"rhel-cloud", "suse-cloud", "ubuntu-os-cloud", "windows-cloud", "gce-nvme"}*
* var errs error*
* for _, project := range projects {*
* image, err := d.GetImageFromProject(project, name, fromFamily)*
* if err != nil {*
* errs = packer.MultiErrorAppend(errs, err)*
* }*
* if image != nil {*
* return image, nil*
* }*
* }*


On Tuesday, April 3, 2018 at 1:42:30 PM UTC-4, Kris wrote:
>
> I am attempting to build a custom image for SQL server, using 
> the sql-std-2016-win-2016 family in the projects/windows-sql-cloud .  I get 
> the error messages below, is this because packer does not know about the 
> projects/windows-sql-cloud?
>
> * googleapi: Error 404: The resource 
> 'projects/centos-cloud/global/images/family/sql-std-2016-win-2016' was not 
> found, notFound
> * googleapi: Error 404: The resource 
> 'projects/coreos-cloud/global/images/family/sql-std-2016-win-2016' was not 
> found, notFound
> * googleapi: Error 404: The resource 
> 'projects/cos-cloud/global/images/family/sql-std-2016-win-2016' was not 
> found, notFound
> * googleapi: Error 404: The resource 
> 'projects/debian-cloud/global/images/family/sql-std-2016-win-2016' was not 
> found, notFound
> * googleapi: Error 404: The resource 
> 'projects/google-containers/global/images/family/sql-std-2016-win-2016' was 
> not found, notFound
> * googleapi: Error 404: The resource 
> 'projects/opensuse-cloud/global/images/family/sql-std-2016-win-2016' was 
> not found, notFound
> * googleapi: Error 404: The resource 
> 'projects/rhel-cloud/global/images/family/sql-std-2016-win-2016' was not 
> found, notFound
> * googleapi: Error 404: The resource 
> 'projects/suse-cloud/global/images/family/sql-std-2016-win-2016' was not 
> found, notFound
> * googleapi: Error 404: The resource 
> 'projects/ubuntu-os-cloud/global/images/family/sql-std-2016-win-2016' was 
> not found, notFound
> * googleapi: Error 404: The resource 
> 'projects/windows-cloud/global/images/family/sql-std-2016-win-2016' was not 
> found, notFound
> * googleapi: Error 404: The resource 
> 'projects/gce-nvme/global/images/family/sql-std-2016-win-2016' was not 
> found, notFound
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/eafd28b2-997e-4525-85b7-19812792240e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [packer] Packer qemu with macvtap

2018-04-04 Thread Alvaro Miranda Aguilera
Hello

Can you try some other project to see if works?

ie try to build this:
https://github.com/stardata/packer-centos7-kvm-example

Then you can modify to suit

On Wed, Apr 4, 2018 at 1:38 AM,  wrote:

> Hey Everyone,
>
> So far nothing has been particularly successful, I suspect my kickstart
> file is off somehow but I'm I need to look into how to test one in the
> first place.
>
> The problem has more or less changed from using a macvtap network to:
> "getting anything to work in a qemu environment."
>
> If there is any additional info I ought to post for my runs let me know.
>
> I'm going to look at VM alternatives and see if I can get any image built
> at all.
>
> Regards,
>
> Tanner
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/packer-tool/13110f9b-229c-4c4d-8901-64fd1b685aa7%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Alvaro

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CAHqq0ezvOi%3D5oEyVE-d%3Di06c_a5-1hz9%2B_6uv5bVtAX9LX9YLg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [packer] MSSQL Image with Packer

2018-04-04 Thread Alvaro Miranda Aguilera
Hello

whats your packer version and can you share your template ?

Seems  sql-std-2016-win-2016 is correct in the list of public VMs.

Alvaro

On Tue, Apr 3, 2018 at 7:42 PM, Kris 
wrote:

> I am attempting to build a custom image for SQL server, using
> the sql-std-2016-win-2016 family in the projects/windows-sql-cloud .  I get
> the error messages below, is this because packer does not know about the
> projects/windows-sql-cloud?
>
> * googleapi: Error 404: The resource 'projects/centos-cloud/global/
> images/family/sql-std-2016-win-2016' was not found, notFound
> * googleapi: Error 404: The resource 'projects/coreos-cloud/global/
> images/family/sql-std-2016-win-2016' was not found, notFound
> * googleapi: Error 404: The resource 'projects/cos-cloud/global/
> images/family/sql-std-2016-win-2016' was not found, notFound
> * googleapi: Error 404: The resource 'projects/debian-cloud/global/
> images/family/sql-std-2016-win-2016' was not found, notFound
> * googleapi: Error 404: The resource 'projects/google-containers/
> global/images/family/sql-std-2016-win-2016' was not found, notFound
> * googleapi: Error 404: The resource 'projects/opensuse-cloud/
> global/images/family/sql-std-2016-win-2016' was not found, notFound
> * googleapi: Error 404: The resource 'projects/rhel-cloud/global/
> images/family/sql-std-2016-win-2016' was not found, notFound
> * googleapi: Error 404: The resource 'projects/suse-cloud/global/
> images/family/sql-std-2016-win-2016' was not found, notFound
> * googleapi: Error 404: The resource 'projects/ubuntu-os-cloud/
> global/images/family/sql-std-2016-win-2016' was not found, notFound
> * googleapi: Error 404: The resource 'projects/windows-cloud/
> global/images/family/sql-std-2016-win-2016' was not found, notFound
> * googleapi: Error 404: The resource 'projects/gce-nvme/global/
> images/family/sql-std-2016-win-2016' was not found, notFound
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/packer-tool/2367edde-f0d2-4d04-9002-b0c858b85cee%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Alvaro

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CAHqq0ez_cZyqoGuH5TbmS_838DzW-ZG1B2dW%2BPCkk4Ur3vqRYQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.