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

aws_ssm_inventory: Inventory plugin for AWS SSM #57550

Open
wants to merge 3 commits into
base: devel
from

Conversation

Projects
None yet
3 participants
@hibbert
Copy link

commented Jun 7, 2019

Change-Id: I6559ebf412226982083b7633f1f4413aa2453bd6

SUMMARY

This allows you to store inventory in AWS SSM under a particular path e.g. /prod and then use the key/value as host vars

e.g SSM parameter
/prod/webservers/nginx/image_version = 1.0

would end up

{
    "_meta": {
        "hostvars": {
            "nginx": {
                "image_version": "1.0"
            }
        }
    },
    "all": {
        "children": [
            "webservers"
        ]
    },
    "webservers": {
        "hosts": [
            "nginx"
        ]
    }
}
ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

aws_ssm

ADDITIONAL INFORMATION
  • Enter parameters into account e.g.
/prod/webservers/nginx/image_version = 1.0
  • Use with aws_ssm.yaml file
plugin: aws_ssm
path: dev
region: us-east-1
aws_profile: default
  • Store file inside dev directory, can include any group_vars as appropriate
  • Authenticate with AWS
  • Retrieve inventory
ansible-inventory -i dev --list --verbose
Andy Hibbert
aws_ssm_inventory: Initial commit
Change-Id: I6559ebf412226982083b7633f1f4413aa2453bd6
@ansibot

This comment has been minimized.

Copy link
Contributor

commented Jun 7, 2019

The test ansible-test sanity --test pylint [explain] failed with 4 errors:

lib/ansible/plugins/inventory/aws_ssm.py:138:31: ansible-format-automatic-specification Format string contains automatic field numbering specification
lib/ansible/plugins/inventory/aws_ssm.py:153:33: ansible-format-automatic-specification Format string contains automatic field numbering specification
lib/ansible/plugins/inventory/aws_ssm.py:180:17: ansible-format-automatic-specification Format string contains automatic field numbering specification
lib/ansible/plugins/inventory/aws_ssm.py:190:21: ansible-format-automatic-specification Format string contains automatic field numbering specification

The test ansible-test sanity --test pep8 [explain] failed with 3 errors:

lib/ansible/plugins/inventory/aws_ssm.py:158:29: E126 continuation line over-indented for hanging indent
lib/ansible/plugins/inventory/aws_ssm.py:193:17: E123 closing bracket does not match indentation of opening bracket's line
lib/ansible/plugins/inventory/aws_ssm.py:198:45: E126 continuation line over-indented for hanging indent

click here for bot help

Andy Hibbert
aws_ssm_inventory:
Change-Id: I99de1b385c52f9c2fc5ac71dcea689bc558ac2cc

@ansibot ansibot removed the ci_verified label Jun 7, 2019

Show resolved Hide resolved lib/ansible/plugins/inventory/aws_ssm.py Outdated
Show resolved Hide resolved lib/ansible/plugins/inventory/aws_ssm.py
Show resolved Hide resolved lib/ansible/plugins/inventory/aws_ssm.py Outdated
Andy Hibbert
aws_ssm_inventory: Use self.get_option, add extends_documentation_fra…
…gment, use boto3_inventory_conn

Change-Id: I2d07307d42d08cb5b33baae346ca9dc5c7cac3af
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.