Ansible cloudformation update stack

血红的双手。 提交于 2019-12-12 09:42:19

问题


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 }}"

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?

Thanks in advance.


回答1:


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.

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.



来源:https://stackoverflow.com/questions/48554612/ansible-cloudformation-update-stack

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!