Getting vars using AWS dynamic inventory plugin

40 views
Skip to first unread message

Rob White

unread,
Aug 2, 2018, 12:45:26 AM8/2/18
to Ansible Project
I want to set some static vars alongside my AWS inventory plugin config but I can't find any doc.  Maybe this isn't supported or maybe my syntax is incorrect.

plugin: aws_ec2
iam_role_arn: arn:aws:iam::1234567890:role/assumed-ansible
regions:
  - ap-southeast-1
hostnames:
  - ip-address
strict_permissions: False
strict: False
keyed_groups:
  - prefix: tag
    key: tags

all:
  vars:
    aws_account_name: myaccount

With a simple playbook to just output aws_account_name it always fails with...

'aws_account_name' is undefined

I've also tried the AWS group name like

aws_ec2:
  vars:
    aws_account_name: myaccount

but that doesn't work either
Reply all
Reply to author
Forward
0 new messages