I wonder if something like this can be done, the problem i'm seeing is that 
the fact name has to be static, and could not use {{ item }}:

   - name: Set each tag to facts
     set_fact:
       list_of_vars: "{{ my_instance.instances | 
map(attribute='tags.list_of_vars') | list | join('\n') }}"

   - name: Split "list_of_vars" variable into a comma separated list
     set_fact:
       item_list: "{{ list_of_vars.split(',') }}"

   - name: lookup SSM Parameter Store secrets
     set_fact:
      * {{ item }}:* "{{ lookup('amazon.aws.ssm_parameter', 
puppet_env+'_'+env+'_{{ item }}', region=ansible_ec2_placement_region) }}"
     with_items: "{{ item_list }}"


This would give me a fact for each comma separated var I put in the tag, if 
only it worked.  Is there a better way to do something like this?

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/b3642db8-15e2-406b-96ba-e49e0d4d50d8n%40googlegroups.com.

Reply via email to