Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cloudformation_facts module in ansible 2.10 returns StackStatus in stack_description. Previously was stack_status #193

Closed
mkyrianov opened this issue Nov 9, 2020 · 6 comments
Assignees
Labels
backlog bug This issue/PR relates to a bug easyfix Good for new comers and easy to start with contribution jira needs_info This issue requires further information. Please answer any outstanding questions priority/medium waiting_on_contributor Needs help. Feel free to engage to get things unblocked

Comments

@mkyrianov
Copy link

SUMMARY

cloudformation_facts module in ansible 2.10 returns StackStatus in stack_description. Previously was stack_status
In ansible 2.9:
cfn_stack.ansible_facts.cloudformation[cfn_stack_name].stack_description.stack_status is defined
In ansible 2.10:
cfn_stack.ansible_facts.cloudformation[cfn_stack_name].stack_description.stack_status is not defined
Instead ansible 2.10 has this dict key defined:
cfn_stack.ansible_facts.cloudformation[cfn_stack_name].stack_description.StackStatus

ISSUE TYPE
  • Bug Report
COMPONENT NAME

cloudformation_facts

ANSIBLE VERSION
ansible 2.10.3
  config file = /home/ubuntu/cosops-ansible/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python2.7/dist-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 2.7.17 (default, Sep 30 2020, 13:38:04) [GCC 7.5.0]

CONFIGURATION
[DEPRECATION WARNING]: DEFAULT_HASH_BEHAVIOUR option, This feature is fragile and not portable, leading to continual 
confusion and misuse , use the ``combine`` filter explicitly instead. This feature will be removed in version 2.13. 
Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
DEFAULT_HASH_BEHAVIOUR(/home/ubuntu/cosops-ansible/ansible.cfg) = merge
DEFAULT_LOAD_CALLBACK_PLUGINS(/home/ubuntu/cosops-ansible/ansible.cfg) = True
DEFAULT_STDOUT_CALLBACK(/home/ubuntu/cosops-ansible/ansible.cfg) = yaml
LOCALHOST_WARNING(/home/ubuntu/cosops-ansible/ansible.cfg) = False

OS / ENVIRONMENT

Ubuntu 18.04

STEPS TO REPRODUCE
- name: "Get a resources list in '{{ cfn_stack_name }}' stack"
  cloudformation_facts:
    stack_name: "{{ cfn_stack_name }}"
    stack_resources: "yes"
    region: "{{ ansible_ec2_placement_region }}"
  register: cfn_stack

- debug:
    msg: "{{ cfn_stack }}"

- name: "Get current stack status of '{{ cfn_stack_name }}' stack"
  set_fact:
    # yamllint disable-line rule:line-length
    cfn_stack_status: "{{ cfn_stack.ansible_facts.cloudformation[cfn_stack_name].stack_description.stack_status }}"
EXPECTED RESULTS

cfn_stack.ansible_facts.cloudformation[cfn_stack_name].stack_description.stack_status variable is defined and return stack actual status

ACTUAL RESULTS
TASK [aws : Get current stack status of 'test-deploy-telemetry' stack] ******************************************************
fatal: [localhost]: FAILED! => 
  msg: |-
    The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'stack_status'
  
    The error appears to be in '/home/ubuntu/cosops-ansible/roles/aws/tasks/cfn_facts.yaml': line 36, column 3, but may
    be elsewhere in the file depending on the exact syntax problem.
  
    The offending line appears to be:
  
  
    - name: "Get current stack status of '{{ cfn_stack_name }}' stack"
      ^ here
    We could be wrong, but this one looks like it might be an issue with
    missing quotes. Always quote template expression brackets when they
    start a value. For instance:
  
        with_items:
          - {{ foo }}
  
    Should be written as:
  
        with_items:
          - "{{ foo }}"

@gravesm gravesm added priority/medium bug This issue/PR relates to a bug and removed needs_triage labels Dec 18, 2020
@ansibullbot
Copy link

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibullbot
Copy link

@ansibullbot ansibullbot added the module module label Jan 13, 2021
@goneri goneri added the waiting_on_contributor Needs help. Feel free to engage to get things unblocked label Jan 22, 2021
@goneri
Copy link
Member

goneri commented Jan 22, 2021

This regression is unfortunate. To preserve the compatibility with the two versions we need now to expose the two keys in the result.

@GomathiselviS
Copy link
Collaborator

@mkyrianov This issue can be resolved by using cloudformation_info instead of cloudformation_facts. cloudformation_facts module is deprecated from amazon.aws 3.0.0 onwards. Please run your task with cloudformation_info module and let us know the result.

@GomathiselviS GomathiselviS added the needs_info This issue requires further information. Please answer any outstanding questions label Aug 26, 2022
@ansibullbot
Copy link

Files identified in the description:
None

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibullbot ansibullbot removed the module module label Aug 26, 2022
@GomathiselviS
Copy link
Collaborator

The issue is fixed with cloudformation_info module from amazon.aws 3.0.0. Hence closing this issue.

abikouo pushed a commit to abikouo/amazon.aws that referenced this issue Sep 18, 2023
…or RawMessageDelievery (SQS) (ansible-collections#640)

Add support for SQS RawMessageDelievery attribute in subscriptions - issue ansible-collections#193

SUMMARY

Added support to configure RawMessageDelievery option when configuring sqs endpoints.
It use boto3 set_subscription_attributes() to configure changes.
It currently supports only this option, but should be easily extended in the future.
Attributes are expected in the form as in the boto3 docs:
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sns.html#SNS.Client.set_subscription_attributes
Fixes ansible-collections#193

ISSUE TYPE


Feature Pull Request

COMPONENT NAME

updates sns_topic.py to support new functionality

example:

- sns_topic:
    name: '{{ sns_topic_topic_name }}'
    display_name: My new topic name
    subscriptions:
    - endpoint: "{{ sqs_arn }}"
      protocol: sqs
      attributes:
        RawMessageDelivery: true

Reviewed-by: Jill R <None>
Reviewed-by: None <None>
Reviewed-by: Alina Buzachis <None>
Reviewed-by: Mark Chappell <None>
abikouo pushed a commit to abikouo/amazon.aws that referenced this issue Sep 18, 2023
…or RawMessageDelievery (SQS) (ansible-collections#640)

Add support for SQS RawMessageDelievery attribute in subscriptions - issue ansible-collections#193

SUMMARY

Added support to configure RawMessageDelievery option when configuring sqs endpoints.
It use boto3 set_subscription_attributes() to configure changes.
It currently supports only this option, but should be easily extended in the future.
Attributes are expected in the form as in the boto3 docs:
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sns.html#SNS.Client.set_subscription_attributes
Fixes ansible-collections#193

ISSUE TYPE


Feature Pull Request

COMPONENT NAME

updates sns_topic.py to support new functionality

example:

- sns_topic:
    name: '{{ sns_topic_topic_name }}'
    display_name: My new topic name
    subscriptions:
    - endpoint: "{{ sqs_arn }}"
      protocol: sqs
      attributes:
        RawMessageDelivery: true

Reviewed-by: Jill R <None>
Reviewed-by: None <None>
Reviewed-by: Alina Buzachis <None>
Reviewed-by: Mark Chappell <None>
abikouo pushed a commit to abikouo/amazon.aws that referenced this issue Oct 24, 2023
…or RawMessageDelievery (SQS) (ansible-collections#640)

Add support for SQS RawMessageDelievery attribute in subscriptions - issue ansible-collections#193

SUMMARY

Added support to configure RawMessageDelievery option when configuring sqs endpoints.
It use boto3 set_subscription_attributes() to configure changes.
It currently supports only this option, but should be easily extended in the future.
Attributes are expected in the form as in the boto3 docs:
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sns.html#SNS.Client.set_subscription_attributes
Fixes ansible-collections#193

ISSUE TYPE


Feature Pull Request

COMPONENT NAME

updates sns_topic.py to support new functionality

example:

- sns_topic:
    name: '{{ sns_topic_topic_name }}'
    display_name: My new topic name
    subscriptions:
    - endpoint: "{{ sqs_arn }}"
      protocol: sqs
      attributes:
        RawMessageDelivery: true

Reviewed-by: Jill R <None>
Reviewed-by: None <None>
Reviewed-by: Alina Buzachis <None>
Reviewed-by: Mark Chappell <None>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog bug This issue/PR relates to a bug easyfix Good for new comers and easy to start with contribution jira needs_info This issue requires further information. Please answer any outstanding questions priority/medium waiting_on_contributor Needs help. Feel free to engage to get things unblocked
Projects
None yet
Development

No branches or pull requests

6 participants