yum_repo.j2 931 B

1234567891011121314151617181920
  1. {% for repo in provision_custom_repositories %}
  2. [{{ repo.id | default(repo.name) }}]
  3. name={{ repo.name | default(repo.id) }}
  4. baseurl={{ repo.baseurl }}
  5. {% set enable_repo = repo.enabled | default(1) %}
  6. enabled={{ 1 if ( enable_repo == 1 or enable_repo == True ) else 0 }}
  7. {% set enable_gpg_check = repo.gpgcheck | default(1) %}
  8. gpgcheck={{ 1 if ( enable_gpg_check == 1 or enable_gpg_check == True ) else 0 }}
  9. {% if 'sslclientcert' in repo %}
  10. sslclientcert={{ "/var/lib/yum/custom_secret_" + (loop.index-1)|string + "_cert" if repo.sslclientcert }}
  11. {% endif %}
  12. {% if 'sslclientkey' in repo %}
  13. sslclientkey={{ "/var/lib/yum/custom_secret_" + (loop.index-1)|string + "_key" if repo.sslclientkey }}
  14. {% endif %}
  15. {% for key, value in repo.iteritems() %}
  16. {% if key not in ['id', 'name', 'baseurl', 'enabled', 'gpgcheck', 'sslclientkey', 'sslclientcert'] and value is defined %}
  17. {{ key }}={{ value }}
  18. {% endif %}
  19. {% endfor %}
  20. {% endfor %}