Skip to content

Instantly share code, notes, and snippets.

@lanky
Created July 11, 2017 14:48
Show Gist options
  • Save lanky/90425512af90211d3b4396d54559d771 to your computer and use it in GitHub Desktop.
Save lanky/90425512af90211d3b4396d54559d771 to your computer and use it in GitHub Desktop.
---
os_repos:
- name: epel
gpgcheck: yes
baseurl: https://wibble.com/repos/epel/x86_64
gpgkey: http://wibbl.com/repos/RPM-GPG-KEY
---
# tasks only, no other funny business
- name: group by OS Type
group_by:
key: "{{ ansible_os_family|lower }}"
- name: add yum repos
yum_repo:
name: "{{ item.name }}"
gpgcheck: "{{ item.gpgcheck|default(True) }}"
baseurl: "{{ item.baseurl }}"
gpgkey: "{{ item.gpgkey }}"
with_items: "{{ os_repos }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment