diff --git a/states/repos/init.sls b/states/repos/init.sls index 05ee7da..c61372b 100644 --- a/states/repos/init.sls +++ b/states/repos/init.sls @@ -2,7 +2,7 @@ {%- for repo in pillar.get('repos') %} {%- if repo['enabled'] %} -pkg-repo-{{ repo['name'] }}: +repo-{{ repo['name'] }}: pkgrepo.managed: - humanname: {{ repo['humanname'] }} {%- if repo['ppa'] %} @@ -10,9 +10,10 @@ pkg-repo-{{ repo['name'] }}: - dist: {{ repo['dist'] }} {%- elif not repo['ppa'] %} - name: {{ repo['src'] }} - - gpgcheck: {{ repo['gpgcheck'] }} + - gpgcheck: {{ repo['gpgcheck']|default(1) }} - file: {{ repo['file'] }} - clean_file: True + {%- if repo['key_method'] is defined %} {%- if repo['key_method'] == 'file' %} - key_url: {{ repo['key_url'] }} {%- elif repo['key_method'] == 'server' %} @@ -20,14 +21,15 @@ pkg-repo-{{ repo['name'] }}: - keyserver: {{ repo['keyserver'] }} {%- endif %} {%- endif %} + {%- endif %} - refresh: True {%- else %} -pkg-repo-{{ repo['name'] }}: +repo-{{ repo['name'] }}: file.absent: {%- if not repo['ppa'] %} - name: {{ repo['file'] }} {%- endif %} {%- endif %} -{%- endfor %} \ No newline at end of file +{%- endfor %}