Hi. Do you have Azure equivalent video? Where’s the Ansible controller installed? Is Ansible installed on ami? If not can it be installed on ami before running the scripts? Thanks
Hi Maz, The Ansible Controller is installed in my local machine and not on the ami. Its not required to install ansible in the ami for this example as the packer uses ansible from our local machine to install stuff into a temporary VM before creating an ami out of it. I dont have an Azure equivalent video yet. Thanks for your interest.
Great video. I am trying to create a hardened linux image. I have an ansible collection which has two roles. These must be executed as a root user. In order to bake these roles into an image, what other parameters do I need to include in packer under ansible provisioner?
@listentolearn great video. I have a doubt, i tried to do this on a ec2 instance, i installed ansible and packer on it and gave the necessary inputs in the variable.hcl.pkr file. yet when i run < packer build . > command, it gets stuck on Waiting to ssh into the instance. What can I do.
Is there a way to specifiy a profile(aws credentials, access keys etc.) and a source_ami_filter(to list virtualization-type, name, and root-device-type)?
Sure. You can define "access_key" and "secret_key" as input variables and pass them as parameters to your source. Instead of using the base ami id in the source, you can user "source_ami_filter". Sample for filtering ubuntu 18.04 image - source_ami_filter { filters = { virtualization-type = "hvm" architecture = "x86_64" name = "ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-*" root-device-type = "ebs" } owners = ["099720109477"] most_recent = true } Thanks.
@@listentolearn2363 Thank you!!! Btw this video was a huge help really amazing stuff. One other question sorry to bombard you. So obviously you are building an Ubuntu AMI, how would you do the same thing you are doing here but with other linux distros? Say Debian for example.
Awesome! glad you figured it out :) and thank you for all your support! Writing down the steps for the benefit of others following the channel - We could list the images using aws cli and use the parameters as filters in source_amii_filter aws ec2 describe-images --region eu-north-1 --owners 136693071363 --query 'sort_by(Images, &CreationDate)[].[CreationDate,Name,ImageId]' --output table references: wiki.debian.org/Amazon/EC2/HowTo/awscli cloud-images.ubuntu.com/locator/ec2/ access.redhat.com/solutions/15356 docs.aws.amazon.com/cli/latest/reference/ec2/describe-images.html
Hi. Do you have Azure equivalent video? Where’s the Ansible controller installed? Is Ansible installed on ami? If not can it be installed on ami before running the scripts? Thanks
Hi Maz,
The Ansible Controller is installed in my local machine and not on the ami.
Its not required to install ansible in the ami for this example as the packer uses ansible from our local machine to install stuff into a temporary VM before creating an ami out of it.
I dont have an Azure equivalent video yet.
Thanks for your interest.
Wow Such an awesome👌 video...I like the video, could you please do more videos on this and terraform.
Thank you :) sure, will do
Great video. I am trying to create a hardened linux image. I have an ansible collection which has two roles. These must be executed as a root user. In order to bake these roles into an image, what other parameters do I need to include in packer under ansible provisioner?
such a good and helpful video. Thanks
You're very welcome! Thanks for your support!
@@listentolearn2363 i am facing error can you share you mail ?
sorry, I dont monitor the mail box. Do you mind sharing your error message here or in the git hub comments please?
@listentolearn great video. I have a doubt, i tried to do this on a ec2 instance, i installed ansible and packer on it and gave the necessary inputs in the variable.hcl.pkr file. yet when i run < packer build . > command, it gets stuck on Waiting to ssh into the instance. What can I do.
Hi Samrath, thanks. Ensure that you allow port 22 inbound access in your security group from local ip.
Is there a way to specifiy a profile(aws credentials, access keys etc.) and a source_ami_filter(to list virtualization-type, name, and root-device-type)?
Sure. You can define "access_key" and "secret_key" as input variables and pass them as parameters to your source.
Instead of using the base ami id in the source, you can user "source_ami_filter".
Sample for filtering ubuntu 18.04 image -
source_ami_filter {
filters = {
virtualization-type = "hvm"
architecture = "x86_64"
name = "ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-*"
root-device-type = "ebs"
}
owners = ["099720109477"]
most_recent = true
}
Thanks.
@@listentolearn2363 Thank you!!! Btw this video was a huge help really amazing stuff. One other question sorry to bombard you. So obviously you are building an Ubuntu AMI, how would you do the same thing you are doing here but with other linux distros? Say Debian for example.
Actually figured it out, thank you again for the help!
Awesome! glad you figured it out :) and thank you for all your support!
Writing down the steps for the benefit of others following the channel -
We could list the images using aws cli and use the parameters as filters in source_amii_filter
aws ec2 describe-images --region eu-north-1 --owners 136693071363 --query 'sort_by(Images, &CreationDate)[].[CreationDate,Name,ImageId]' --output table
references:
wiki.debian.org/Amazon/EC2/HowTo/awscli
cloud-images.ubuntu.com/locator/ec2/
access.redhat.com/solutions/15356
docs.aws.amazon.com/cli/latest/reference/ec2/describe-images.html