diff --git a/states/repos/init.sls b/states/repos/init.sls index f15e41c..00816b7 100644 --- a/states/repos/init.sls +++ b/states/repos/init.sls @@ -1,4 +1,4 @@ --- include: - .prereqs - - .keyring + - .install diff --git a/states/repos/keyring.sls b/states/repos/install.sls similarity index 71% rename from states/repos/keyring.sls rename to states/repos/install.sls index 480d920..5394008 100644 --- a/states/repos/keyring.sls +++ b/states/repos/install.sls @@ -1,29 +1,29 @@ --- {%- from "repos/map.jinja" import repos with context %} -{%- for repo in repos %} +{%- for name,repo in repos.items() %} {%- if repo.enabled %} {%- if repo.key_method is defined %} {%- if repo.key_method == 'file' %} -repo-key-{{ repo.name }}: +repo-key-{{ name }}: file.managed: - - name: /etc/apt/keyrings/{{ repo.name }} + - name: /etc/apt/keyrings/{{ name }} - source: {{ repo.key_url }} - skip_verify: true {% endif %} {% endif %} -repo-{{ repo.name }}: +repo-{{ name }}: pkgrepo.managed: - humanname: {{ repo.humanname }} {%- if repo.ppa %} - ppa: {{ repo.ppasrc }} - dist: {{ repo.dist }} {%- else %} - - name: deb [signed-by=/etc/apt/keyrings/{{ repo.name }}] {{ repo.src }} {{ repo.suites }} {{ repo.components }} + - name: deb [signed-by=/etc/apt/keyrings/{{ name }}] {{ repo.src }} {{ repo.suites }} {{ repo.components }} - gpgcheck: {{ repo.gpgcheck|default(1) }} - aptkey: false - - file: {{ repo.file }} + - file: /etc/apt/sources.list.d/{{ name }}.list - clean_file: true {%- if repo.key_method is defined %} {%- if repo.key_method == 'file' %} @@ -36,12 +36,11 @@ repo-{{ repo.name }}: {%- endif %} {%- else %} -repo-{{ repo.name }}: +repo-{{ name }}: file.absent: {%- if not repo.ppa %} - - name: {{ repo.file }} + - name: /etc/apt/sources.list.d/{{ name }}.list {%- endif %} {%- endif %} {%- endfor %} -