You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On running the cloudformation_stack_set module the first time it successfully creates the stackset and deploys the stack instances. On future runs of the play without nothing changed an additional update operation is run and changed is returned as true.
On each run it creates a new operation in the stackets console, again despite nothing being changed.
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.4 LTS
Release: 18.04
Codename: bionic
STEPS TO REPRODUCE
- name: Create test stacksetcloudformation_stack_set:
name: iam-core-stackset.ymldescription: Test stack in two accountsregion: ap-southeast-2 state: presentcapabilities: CAPABILITY_NAMED_IAMtemplate: "{{role_path}}/templates/iam-core-stackset.yml"accounts: [12345679878]regions:
- ap-southeast-2
EXPECTED RESULTS
On first run it works fine:
TASK [baseline-stacksets : Create test core stackset] *****************************************************************************************************************************************************************************
changed: [localhost]
Each time I run the module a new stackset operation is created. This should not happen when nothing has changed in the task.
It's possible this was a design choice but essentially there's no comparison being done to compare the existing stack facts against the arguments in the ansible task. In the below, if there's no existing_stack_set, one is created. Else, the update_stack_set function is called. I feel there should be some comparison being done between the stack_params dict and the existing_stack_set dict to determine if an update is required.
if state == 'present':
if not existing_stack_set:
# on create this parameter has a different name, and cannot be referenced later in the job log
stack_params['ClientRequestToken'] = 'Ansible-StackSet-Create-{0}'.format(operation_uuid)
changed = True
create_stack_set(module, stack_params, cfn)
else:
stack_params['OperationId'] = 'Ansible-StackSet-Update-{0}'.format(operation_uuid)
operation_ids.append(stack_params['OperationId'])
if module.params.get('regions'):
stack_params['OperationPreferences'] = get_operation_preferences(module)
changed |= update_stack_set(module, stack_params, cfn)
The text was updated successfully, but these errors were encountered:
Hi @goneri, I would create a change_set, just like with a normal stack. However, I believe this functionality is not available in AWS (for stack sets), so it would be a custom implementation.
SUMMARY
On running the cloudformation_stack_set module the first time it successfully creates the stackset and deploys the stack instances. On future runs of the play without nothing changed an additional update operation is run and changed is returned as true.
On each run it creates a new operation in the stackets console, again despite nothing being changed.
ISSUE TYPE
COMPONENT NAME
cloudformation_stack_set AWS module
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.4 LTS
Release: 18.04
Codename: bionic
STEPS TO REPRODUCE
EXPECTED RESULTS
On first run it works fine:
TASK [baseline-stacksets : Create test core stackset] *****************************************************************************************************************************************************************************
changed: [localhost]
PLAY RECAP ************************************************************************************************************************************************************************************************************************
localhost : ok=3 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
On second run without change it chould be changed=0 and nothing changes.
ACTUAL RESULTS
On the 2nd (and any future) run of the play:
Each time I run the module a new stackset operation is created. This should not happen when nothing has changed in the task.
It's possible this was a design choice but essentially there's no comparison being done to compare the existing stack facts against the arguments in the ansible task. In the below, if there's no existing_stack_set, one is created. Else, the update_stack_set function is called. I feel there should be some comparison being done between the stack_params dict and the existing_stack_set dict to determine if an update is required.
The text was updated successfully, but these errors were encountered: