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 multi-stack support #56478

Open
wants to merge 5 commits into
base: devel
from

Conversation

Projects
None yet
2 participants
@sosheskaz
Copy link
Contributor

commented May 15, 2019

SUMMARY

I have a use case where I often want information on multiple Cloudformation stacks in one invocation, and it is just simpler to get them all at once.

The parameter name stack_name is changed to stack_names to reflect the true functionality, though stack_name is added as an alias for backwards compatibility.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

cloudformation_facts

ADDITIONAL INFORMATION

Before

$ ansible localhost -m "cloudformation_facts" -a "region=us-west-2 stack_name={{['emiller01','emiller02']}}"
 [WARNING]: Unable to parse /etc/ansible/hosts as an inventory source

 [WARNING]: No inventory was parsed, only implicit localhost is available

 [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ClientError: An error occurred (ValidationError) when calling the DescribeStacks operation: 1 validation error detected: Value '['emiller01', 'emiller02']' at 'stackName' failed to satisfy constraint: Member must satisfy regular expression pattern: [a-zA-Z][-a-zA-Z0-9]*|arn:[-a-zA-Z0-9:/._+]*
localhost | FAILED! => {
    "changed": false, 
    "msg": "Error describing stack - An error occurred (ValidationError) when calling the DescribeStacks operation: 1 validation error detected: Value '['emiller01', 'emiller02']' at 'stackName' failed to satisfy constraint: Member must satisfy regular expression pattern: [a-zA-Z][-a-zA-Z0-9]*|arn:[-a-zA-Z0-9:/._+]*"
}

After

ANSIBLE_LIBRARY=lib/ansible/modules ansible localhost -m "cloudformation_facts" -a "region=us-west-2 stack_name={{['emiller01','emiller02']}}"
 [WARNING]: Unable to parse /etc/ansible/hosts as an inventory source

 [WARNING]: No inventory was parsed, only implicit localhost is available

 [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'

localhost | SUCCESS => {
    "ansible_facts": {
        "cloudformation": {}
    }, 
    "changed": false
}
@ansibot

This comment has been minimized.

Copy link
Contributor

commented May 15, 2019

@ansibot

This comment has been minimized.

Copy link
Contributor

commented May 15, 2019

@sosheskaz, just so you are aware we have a dedicated Working Group for aws.
You can find other people interested in this in #ansible-aws on Freenode IRC
For more information about communities, meetings and agendas see https://github.com/ansible/community

click here for bot help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.