Figured it out:
- name: Install Spacewalk Repos
  yum:
    name: "{{ item }}"
    state: present
  with_items:
    - "first-package-{{ ansible_distribution_major_version }}.noarch.rpm"
    - "second-package{{ ansible_distribution_major_version }}.noarch.rpm"



On Tuesday, April 24, 2018 at 4:02:29 PM UTC-6, John Harmon wrote:
>
> I have seen other people attempting similar things, but what works for 
> them in their scenarios doesn't seem to work for me.  I am sure it must be 
> a syntax issue.  I have a similar when statement, but don't know how to 
> correctly reference my fact within the string as seen below (tried these 
> two, and various other iterations):
> - name: Install Spacewalk Repos
>   yum:
>     name: "{{ item }}"
>     state: present
>   with_items:
>     - first-package-['ansible_distribution_major_version'].noarch.rpm
>     - second-package[ansible_distribution_major_version].noarch.rpm
>
>
>

-- 
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/1f74e7a7-70dc-4948-b6a6-dc093ddfe09a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to