Ansible cloudformation更新堆栈 [英] Ansible cloudformation update stack

查看:104
本文介绍了Ansible cloudformation更新堆栈的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用仅需要通过Ansible更改的参数值来更新cloudformation堆栈。堆栈是先前创建的,具有大约20个输入参数,但是我只需要更新其中一个的值即可。我尝试了以下操作:

I'm trying to update a cloudformation stack with just a param value that I need to change via Ansible. The stack is previously created and has about 20 input params, but I just need to update the value for one. I tried the following:

- name: update
  cloudformation:
    stack_name: "{{ stack_name }}"
    state: present
    region: "{{ region }}"
    disable_rollback: false
  args:
    template_parameters:
      CreateAlarms: "{{ create_alarms }}"

在我运行该游戏时,该剧引发错误,指出它期望该值其他模板参数。从此处的ansible文档中 http://docs.ansible.com/ansible/latest/cloudformation_module。 html ,它说:如果存在 state ,则说明堆栈确实存在,并且 template template_url 被指定,先前的模板将被重用。如何告诉cloudformation模块也使用以前的值?我知道aws cli通过usePreviousValue标志支持它,但是我如何使用Ansible cloudformation来做到这一点?

When I run it, the play throws an error stating that it expects values for the other template params. From the ansible documentation here http://docs.ansible.com/ansible/latest/cloudformation_module.html, it says "If state is present, the stack does exist, and neither template nor template_url is specified, the previous template will be reused." How do I tell the cloudformation module to use previous values as well? I know that aws cli supports it via the usePreviousValue flag, but how I do it with Ansible cloudformation?

预先感谢。

推荐答案

当前此处可用的 cloudformation 模块。没有重用以前的值的方法,您必须每次都指定参数。通常这很好,因为无论如何您都将参数存储在Ansible剧本中。

author/maintainer of the current Ansible cloudformation module here. There isn't a method to reuse previous values, you must specify the parameters every time. Usually that's fine because you have your params stored in your Ansible playbook anyhow.

如果您很紧张,则这些值会在cloudformation控制台中列出,您也可以使用变更集确保只有期望值在变化。

If you're nervous, the values are listed in the cloudformation console, and you can also use changesets in Ansible to make sure only the expected are changing.

这篇关于Ansible cloudformation更新堆栈的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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