Much like this question regarding passing an array mine is a bit different
The OP, was trying to give the play multiple hosts to run on.
Fails clearly. My goal is to "loop" through my play on each account within my .boto
configuration file. Sure I could leverage a simple bash loop. But was thinking to do something more with Ansible, by passing specific "acct" vars into it. *Updated with task that fails.
- name: Ansible Roles in AWS .v01
hosts: 127.0.0.1
gather_facts: no
connection: local
vars:
role_state: present
dict1: { "dev", "mgmt", "uat", "sbx" }
# - debug: var=
tasks:
- name: hhc-ADMIN-Role-Create
with_items: dict1
tags:
- admin
iam:
iam_type: role
region: us-east-1
profile: "{{ item }}"
name: hhc-{{ dict1 }}-ADMIN
state: "{{role_state}}"
trust_policy_filepath: ./Policies/Trust/Role-Trust-Policy.json
One method to utilize a "list" would be the following:
This will create a role of ADMIN and MGMT in Dev. There has got to be a more elegant way to do something like