--- {%- for repo in pillar.get('repos') %} {%- if repo['enabled'] %} pkg-repo-{{ repo['name'] }}: pkgrepo.managed: - humanname: {{ repo['humanname'] }} {%- if repo['ppa'] %} - ppa: {{ repo['ppasrc'] }} - dist: {{ repo['dist'] }} {%- elif not repo['ppa'] %} - name: {{ repo['src'] }} - gpgcheck: {{ repo['gpgcheck'] }} - file: {{ repo['file'] }} - clean_file: True {%- if repo['key_method'] == 'file' %} - key_url: {{ repo['key_url'] }} {%- elif repo['key_method'] == 'server' %} - keyid: {{ repo['keyid'] }} - keyserver: {{ repo['keyserver'] }} {%- endif %} {%- endif %} - refresh: True {%- else %} pkg-repo-{{ repo['name'] }}: file.absent: {%- if not repo['ppa'] %} - name: {{ repo['file'] }} {%- endif %} {%- endif %} {%- endfor %}