AWS Inventory seems to using script, not plugin

,

Hi! I’m trying to get an inventory from AWS and I don’t see anywhere to enter in the information I have in my aws_ec2.yaml file . . . Is it possible that I’m looking at a version that uses the old script instead? Here’s what I’m seeing

Aren’t there supposed to be fields for region, Instance FIlter, Only Group By, etc? Anyone have any idea what I’m doing wrong?

Thanks!
Guy

 ______________ 
<  AWX 15.0.0  >
 -------------- 
        \   ^__^
         \  (oo)\_______
            (__)      A )\/\
                >>----w |
                >>     >>

Ansible 2.9.13

Guy Matz (guymatz@gmail.com) said:

Hi! I'm trying to get an inventory from AWS and I don't see anywhere to
enter in the information I have in my aws_ec2.yaml file . . . Is it
possible that I'm looking at a version that uses the old script instead?

The configuration goes in the source variables.

Bill

That seemed to work! One little hitch: Does anyone know how I can get ansible_hostname to use tag:Name? The code below works on CLI but not in AWX:

see https://docs.ansible.com/ansible/latest/plugins/inventory/aws_ec2.html

plugin: aws_ec2
strict: True
#cache: yes
regions:

  • us-east-1
  • us-west-1
  • us-west-2

keyed_groups may be used to create custom groups

keyed_groups:

  • prefix: arch
    key: ‘architecture’
  • key: tags[‘Env’]|default(‘NA’)
    prefix: tag_Env
  • key: tags[‘Role’]|default(‘NA’)
    prefix: tag_Role
    groups:
    aws: true
    atlassian: “‘confluence’ in tags|replace(‘-’, ‘‘) or ‘jira’ in tags|replace(’-', '’)”
    confluence: “‘confluence’ in tags|replace(‘-’, ‘‘)"
    jira: "‘jira’ in tags|replace(’-', '
    ’)”
    prime: “‘prime’ in tags|replace(‘-’, ‘‘)"
    squish: "‘testcenter’ in tags|replace(’-', '
    ’)”
    pomerium: “‘pom’ in tags|replace(‘-’, '’)”
    bastion: “‘true’ in tags[‘Bastion’]|default(‘false’)|replace(‘-’, ‘_’)”

NOT using hostnames in favor of jinja below (ansible_ssh_host)

#hostnames:

- private-ip-address

- private-dns-name

- dns-name

- network-interface.addresses.association.public-ip

Set individual variables with compose

compose:
ansible_user: tags[‘User’]|default(‘centos’)
ansible_ssh_private_key_file: key_name|default(‘no_key’)|regex_replace(‘^(.*)$’, ‘~/.ssh/\1.pem’)
ansible_ssh_host: public_ip_address
if (
private_ip_address is not defined
or
private_ip_address.startswith(‘10.’)
or
(tags[‘Env’] is defined and tags[‘Env’]==‘test’)
)
and (public_ip_address is defined)
else
private_ip_address