Browse Source

Change requisite clausule.

Add check for existing key for idempotency.
pull/150/head
Martin Horak 6 years ago
parent
commit
f1feaf60a3
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      linux/system/repo.sls

+ 4
- 2
linux/system/repo.sls View File

linux_repo_{{ name }}_key: linux_repo_{{ name }}_key:
cmd.run: cmd.run:
- name: "echo '{{ repo.key }}' | apt-key add -" - name: "echo '{{ repo.key }}' | apt-key add -"
- onchange:
- unless: "apt-key finger --with-colons | grep -qF $(echo '{{ repo-key }} | gpg --with-fingerprint --with-colons | grep -E '^fpr')"
- require_in:
- pkgrepo: linux_repo_{{ name }} - pkgrepo: linux_repo_{{ name }}


{%- elif repo.key_url|default(False) %} {%- elif repo.key_url|default(False) %}
linux_repo_{{ name }}_key: linux_repo_{{ name }}_key:
cmd.run: cmd.run:
- name: "curl -s {{ repo.key_url }} | apt-key add -" - name: "curl -s {{ repo.key_url }} | apt-key add -"
- onchange:
- unless: "apt-key finger --with-colons | grep -qF $(curl -s {{ repo.key_url }} | gpg --with-fingerprint --with-colons | grep -E '^fpr')"
- require_in:
- pkgrepo: linux_repo_{{ name }} - pkgrepo: linux_repo_{{ name }}


{%- endif %} {%- endif %}

Loading…
Cancel
Save