Re: [packer] * 'temporary_security_group_source_cidrs': source data must be an array or slice, got map

2019-08-08 Thread John Roh
Thank you, Rickard.

However, it goes to "variable packer_temporary_security_group_source_cidrs: 
'' expected type 'string', got unconvertible type '[]interface {}'" 
I'm on version 1.4.2

John. 

On Thursday, August 8, 2019 at 2:20:16 AM UTC-7, Rickard von Essen wrote:
>
> It's a list of strings (CIDRs) [ "10.0.0.0/16" ].
>
>
> On Thu, Aug 8, 2019, 09:22 John Roh > 
> wrote:
>
>> Hi there?
>> I need to figure out how to define mutiple cidrs while the packer build 
>> runs. 
>> Per documentation, temporary_security_group_source_cidrs 
>> 
>>  (list 
>> of string) - A list of IPv4 CIDR blocks to be authorized access to the 
>> instance, when packer is creating a temporary security group.".
>>
>> I must be defined wrong that I'm getting the error message as below. 
>>  'temporary_security_group_source_cidrs': source data must be an array or 
>> slice, got map
>>
>> What might be the appropriate way to define the multiple cdirs?
>>
>> Thank you in advance,
>>
>> John.
>>
>> -- 
>> 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 packe...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/packer-tool/250cf400-53cf-4e08-a774-4762c559c2dc%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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/88aa4ffd-5afd-42ce-b5ff-68e9ad6da185%40googlegroups.com.


Re: [packer] Using Packer in conjunction with Gitlab CI to create build artifacts in my AWS VPC

2019-08-08 Thread Alvaro Miranda Aguilera
Hello

Seems what you want is just a CI worker and AWS cli

packer is a tool that bulild VMs/AMIs/Docker primarily.

you could add a manifest post processor, and grab de AMI created there and
just delete it if you don't need it



On Wed, Aug 7, 2019 at 10:09 PM Dean Kayton  wrote:

> It seems that Packer was only designed for specific build artifacts,
> Docker images and AMIs for example.
>
> What I want is for Packer to spin up an instance with a specific IAM role
> in my own VPC, build Docker images and push to ECR. Also copy the compiled
> source code to an s3 bucket. Even copy certain files back to the CI tool to
> be used on subsequent builds.
>
> This is all very manageable with Packer, except it annoyingly insists on
> saving an AMI at the end. Why is there no way of skipping that final step!?
> This has got me thinking that maybe I am using the wrong tool.
>
> If so what is the correct tool? Is there maybe a Terraform module that can
> do the same? Years ago, I hacked around and ended up making a set of
> Terraform templates that worked with Gitlab CI for example.
>
>
> Here is an example of a Gitlab CI template that works:
>
>
> stages:
>   - build
> .ci:  |
>   wget 
> https://raw.githubusercontent.com/dnk8n/remote-provisioner/master/src/terraform/terraform.aws.main.tf
>   terraform init
>   terraform apply -auto-approve=true || JOB_STATUS=$?
>   terraform destroy -auto-approve=true
>   exit ${JOB_STATUS:-0}
> variables:
>   TF_VAR_region: eu-west-1
>   TF_VAR_iam_instance_profile: builder
> build-example:
>   stage: build
>   image:
> name: hashicorp/terraform:0.12.5
> entrypoint: [""]
>   variables:
> TF_VAR_file_or_dir_source: ${CI_PROJECT_DIR}/
> TF_VAR_file_or_dir_dest: /home/ubuntu/
> TF_VAR_remote_command: '["chmod +x /home/ubuntu/path/to/build.sh", 
> "/home/ubuntu/path/to/build.sh"]'
> TF_VAR_instance_type: t3a.micro
> TF_VAR_timeout_minutes: '10'
>   script:
> - *ci
>
>
>
> The following requirements are assumed:
>
> - *${CI_PROJECT_DIR}/path/to/build.sh* exists, where ${CI_PROJECT_DIR} is
> the root of your repo
> - You want to send all the contents of your repo (
> TF_VAR_file_or_dir_source) to /home/ubuntu on the remote instance (
> TF_VAR_file_or_dir_dest) and you don't need anything else for the build
>
> More explanation at https://github.com/dnk8n/remote-provisioner
>
> I would honestly love to use Packer instead, but then skip the creation of
> AMIs which are unnecessary for my use case. I could use Packer directly in
> the CI tool to create a Docker image, but often that gives issues (because
> of CI tools running as docker containers themselves. It would be nice to
> have a 'remote-docker' Packer builder which works in a similar way to the
> ebs-builder but results in a Docker image in ECR instead of an AMI.
>
> --
> 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/bcddfa06-ff8d-45d7-8bdc-7be593a21ce4%40googlegroups.com
> 
> .
>


-- 
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/CAHqq0ewOSew9%3Du%2BsH1B2Fvs%2BSfAXyB1GmNoEK%3DS1fsF%3D9WjQsw%40mail.gmail.com.


[packer] Can't disable debug messages when using Packer as a library

2019-08-08 Thread Pedro Pereira
Hey list!

So, I'm using Packer as a library for a little Go project and I'm having 
trouble with controlling the output of the builds as I can't disable the 
debug messages.

What I did so far was:

   - Created a Core Config
   - Created a Packer Core based on the Core Config by calling 
   packer.NewCore(config)
   - Created a Build by calling Packer Core's .Build() function
   - Called SetDebug(false) on the build generated on the step above
   - Called Prepare() and then Run()
   - It doesn't matter which type of UI I pass to Run() the debug messages 
   are still shown.
   
The build process works just fine and an image is created in my GCP 
account. But I keep seeing multiple debug messages even after calling 
SetDebug() before calling Prepare(), as instructed by the comments in 
Packer's source code. For example:
2019/08/08 14:50:01 [DEBUG] Opening new ssh session
2019/08/08 14:50:01 [DEBUG] Starting remote scp process:  scp -vt /tmp
2019/08/08 14:50:01 [DEBUG] Started SCP session, beginning transfers...
2019/08/08 14:50:01 [DEBUG] Copying input data into temporary file so we 
can read the length
2019/08/08 14:50:01 [DEBUG] scp: Uploading script_7943.sh: perms=C0644 size=
61
2019/08/08 14:50:01 [DEBUG] SCP session complete, closing stdin pipe.

Does anybody have any pointers? What am I missing here?

-- 
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/8738736e-5aac-4ef3-89bf-48801eacfe14%40googlegroups.com.


Re: [packer] * 'temporary_security_group_source_cidrs': source data must be an array or slice, got map

2019-08-08 Thread Rickard von Essen
It's a list of strings (CIDRs) [ "10.0.0.0/16" ].


On Thu, Aug 8, 2019, 09:22 John Roh  wrote:

> Hi there?
> I need to figure out how to define mutiple cidrs while the packer build
> runs.
> Per documentation, temporary_security_group_source_cidrs
> 
>  (list
> of string) - A list of IPv4 CIDR blocks to be authorized access to the
> instance, when packer is creating a temporary security group.".
>
> I must be defined wrong that I'm getting the error message as below.
>  'temporary_security_group_source_cidrs': source data must be an array or
> slice, got map
>
> What might be the appropriate way to define the multiple cdirs?
>
> Thank you in advance,
>
> John.
>
> --
> 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/250cf400-53cf-4e08-a774-4762c559c2dc%40googlegroups.com
> 
> .
>

-- 
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/CALz9Rt90k0XK-CrpVc2sbOWLRmRgbqDzSskmKWcMQf9uWTnFNA%40mail.gmail.com.


[packer] * 'temporary_security_group_source_cidrs': source data must be an array or slice, got map

2019-08-08 Thread John Roh
Hi there?
I need to figure out how to define mutiple cidrs while the packer build 
runs. 
Per documentation, temporary_security_group_source_cidrs 

 (list 
of string) - A list of IPv4 CIDR blocks to be authorized access to the 
instance, when packer is creating a temporary security group.".

I must be defined wrong that I'm getting the error message as below. 
 'temporary_security_group_source_cidrs': source data must be an array or 
slice, got map

What might be the appropriate way to define the multiple cdirs?

Thank you in advance,

John.

-- 
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/250cf400-53cf-4e08-a774-4762c559c2dc%40googlegroups.com.