是否有用于创建基于“实例存储"的 AMI 的 Ansible 模块? [英] Is there an Ansible module for creating 'instance-store' based AMI's?

查看:36
本文介绍了是否有用于创建基于“实例存储"的 AMI 的 Ansible 模块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从 EBS 支持的实例创建 AMI 非常容易,但从基于 instance-store 的实例中创建 AMI 似乎只能使用 CLI 手动完成.

Creating AMI's from EBS backed instances is exceedingly easy, but doing the same from an instance-store based instance seems like it can only be done manually using the CLI.

到目前为止,我已经能够使用 Ansible 从 HVM Amazon Linux AMI 引导创建基于实例存储"的服务器,但我在接下来的步骤中迷失了......我尝试遵循此操作:http:///docs.aws.amazon.com/AWSEC2/latest/UserGuide/create-instance-store-ami.html#amazon_linux_instructions

So far I've been able to bootstrap the creation of an 'instance-store' based server off of an HVM Amazon Linux AMI with Ansible, but I'm getting lost on the steps that follow... I'm trying to follow this: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/create-instance-store-ami.html#amazon_linux_instructions

显然我需要在实例上存储我的 x.509 证书和密钥,但那是哪个密钥?那是……

Apparently I need to store my x.509 cert and key on the instance, but which key is that? Is that...

  • 我必须使用 openssl 在实例上生成一个,
  • 我从 AWS 生成/转换的一个,
  • 我用 Putty 生成的,或者
  • 我的 AWS 账户中已经存在的一个?

在那之后,我在 Ansible 中找不到任何对 ec2-bundle-vol 的引用.所以我想知道是否唯一的方法是使用 Ansible 的 command 模块.

After that, I can't find any reference to ec2-bundle-vol in Ansible. So I'm left wondering if the only way to do this is with Ansible's command module.

基本上我希望找到的是:有没有办法使用 Ansible 轻松创建基于 instance-store 的 AMI,如果没有,如果有人可以参考必要的步骤自动执行此操作?谢谢!

Basically what I'm hoping to find out is: Is there a way to easily create instance-store based AMI's using Ansible, and if not, if anyone can reference the steps necessary to automate this? Thanks!

推荐答案

一般来说,Ansible AWS 模块旨在通过与 AWS HTTP API 交互来管理 AWS 资源(即,您可以在 AWS 管理控制台中执行的其他操作).

Generally speaking, Ansible AWS modules are meant to manage AWS resources by interacting with AWS HTTP API (ie. actions you could otherwise do in the AWS Management Console).

它们不是为了在 EC2 实例上运行 AWS 特定的系统工具.

They are not intended to run AWS specific system tools on EC2 instances.

ec2-bundle-volec2-upload-bundle 必须在 EC2 实例本身上运行.它不能通过 HTTP API 调用.

ec2-bundle-vol and ec2-upload-bundle must be run on the EC2 instance itself. It is not callable via the HTTP API.

恐怕您需要编写一个自定义剧本/角色来自动执行该过程.

I'm afraid you need to write a custom playbook / role to automate the process.

另一方面,aws ec2 register-image 是 AWS API 调用,对应于 ec2_ami Ansible 模块.不幸的是,这个模块似乎不支持从 S3 存储桶注册图像.

On the other hand, aws ec2 register-image is an AWS API call and correspond to the ec2_ami Ansible module. Unfortunately, this module doesn't seem to support image registering from an S3 bucket.

这篇关于是否有用于创建基于“实例存储"的 AMI 的 Ansible 模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆