Skip to content

Commit

Permalink
Use gpg key from pillar
Browse files Browse the repository at this point in the history
  • Loading branch information
epcim committed May 29, 2017
1 parent de189be commit 550de7d
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions aptly/server/mirrors.sls
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,20 @@ aptly_mirror_update_cron_obsolete:
{%- for mirror_name, mirror in server.mirror.iteritems() %}
{% set _gpg_attributes=--no-tty --no-default-keyring{% if server.gpg.get('keyring', None) %} --keyring {{ server.gpg.keyring }} {% endif %}{% if server.gpg.get('homedir', None) %} --homedir {{ server.gpg.homedir }} {% endif %} %}
{%- for gpgkey in mirror.get('gpgkeys', []) %}
gpg_add_keys_{{ mirror_name }}_{{ gpgkey }}:
cmd.run:
- name: gpg --no-tty --no-default-keyring{% if server.gpg.get('keyring', None) %} --keyring {{ server.gpg.keyring }} {% endif %}{% if server.gpg.get('homedir', None) %} --homedir {{ server.gpg.homedir }} {% endif %}--keyserver {{ mirror.keyserver|default(server.gpg.keyserver) }} --recv-keys {{ gpgkey }}
{%- if server.source.engine != "docker" %}
{%- if gpgkey|length > 1 %}
- name: echo "{{ gpgkey }}" | gpg --import {{ _gpg_attributes }}
{%- else %}
- name: gpg {{ _gpg_attributes }} --keyserver {{ mirror.keyserver|default(server.gpg.keyserver) }} --recv-keys {{ gpgkey }}
- unless: gpg {{ _gpg_attributes }} --list-public-keys {{ gpgkey }}
{%- endif %}
{%- if server.source.engine != "docker" %}
- user: {{ server.user.name }}
- cwd: {{ server.home_dir }}
{%- endif %}
- unless: gpg --no-tty --no-default-keyring{% if server.gpg.get('keyring', None) %} --keyring {{ server.gpg.keyring }} {% endif %}{% if server.gpg.get('homedir', None) %} --homedir {{ server.gpg.homedir }} {% endif %}--list-public-keys {{gpgkey}}
{%- endif %}
{%- endfor %}
Expand Down

0 comments on commit 550de7d

Please sign in to comment.