From 41241e9691fcbe04b1cc1e0b353005223c316e77 Mon Sep 17 00:00:00 2001 From: Logan V Date: Thu, 14 Jan 2016 12:46:57 -0600 Subject: [PATCH] Allow sourcing apt_key from ansible host This change allows deployers to specify locally sourced apt keys on the ansible host rather than requiring all apt keys to be downloaded from upstream keyservers. The current implementation requires that all containers and hosts we deploy to have an internet connection to download apt keys for the various repos. This change allows the user to source apt keys from the deployment host like for example: ceph_gpg_keys: - key_name: 'ceph' data: "{{ lookup('file', '/etc/openstack_deploy/keys/ceph.gpg') }}" hash_id: '0xe84ac2c0460f3994' Note: Deployers can already set the repo URLs to use local sources, so this enables fully offline package installation. Change-Id: I1607c7a5c9bb4d5e06dedbc76c84a77014305df2 --- playbooks/roles/ceph_client/tasks/ceph_preinstall.yml | 3 ++- playbooks/roles/haproxy_server/tasks/haproxy_add_ppa_repo.yml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/playbooks/roles/ceph_client/tasks/ceph_preinstall.yml b/playbooks/roles/ceph_client/tasks/ceph_preinstall.yml index 32d3c14532..fbf524d8aa 100644 --- a/playbooks/roles/ceph_client/tasks/ceph_preinstall.yml +++ b/playbooks/roles/ceph_client/tasks/ceph_preinstall.yml @@ -25,7 +25,8 @@ - name: Add ceph apt-keys apt_key: id: "{{ item.hash_id }}" - keyserver: "{{ item.keyserver }}" + keyserver: "{{ item.keyserver | default(omit) }}" + data: "{{ item.data | default(omit) }}" state: "present" register: add_keys until: add_keys|success diff --git a/playbooks/roles/haproxy_server/tasks/haproxy_add_ppa_repo.yml b/playbooks/roles/haproxy_server/tasks/haproxy_add_ppa_repo.yml index 17a483350a..069aa37551 100644 --- a/playbooks/roles/haproxy_server/tasks/haproxy_add_ppa_repo.yml +++ b/playbooks/roles/haproxy_server/tasks/haproxy_add_ppa_repo.yml @@ -39,7 +39,8 @@ - name: Add haproxy apt-keys apt_key: id: "{{ item.hash_id }}" - keyserver: "{{ item.keyserver }}" + keyserver: "{{ item.keyserver | default(omit) }}" + data: "{{ item.data | default(omit) }}" state: "present" register: add_keys until: add_keys|success