yumrepo.j2 767 B

123456789101112131415161718
  1. {% set repos = item.repos %}
  2. {% for repo in repos %}
  3. [{{ repo.id }}]
  4. name={{ repo.name }}
  5. baseurl={{ repo.baseurl }}
  6. {% set repo_enabled_value = repo.enabled | default(repo_enabled) %}
  7. {% set enable_repo = 1 if (repo_enabled_value | int(0) == 1 or repo_enabled_value | lower in ['true', 'yes']) else 0 %}
  8. enabled={{ enable_repo }}
  9. {% set repo_gpgcheck_value = repo.gpgcheck | default(repo_gpgcheck) %}
  10. {% set enable_gpgcheck = 1 if (repo_gpgcheck_value | int(0) == 1 or repo_gpgcheck_value | lower in ['true', 'yes']) else 0 %}
  11. gpgcheck={{ enable_gpgcheck }}
  12. {% for key, value in repo.iteritems() %}
  13. {% if key not in ['id', 'name', 'baseurl', 'enabled', 'gpgcheck'] and value is defined and value != '' %}
  14. {{ key }}={{ value }}
  15. {% endif %}
  16. {% endfor %}
  17. {% endfor %}