Make apt key import for Ubuntu a uniform process

In https://review.openstack.org/588962 the implementation
of the apt key store copy into the container was changed
for bionic, but left alone for xenial. This patch makes
the approach uniform across both distributions.

Change-Id: I79f49fd02be3bbee5f22cdde000b19578167e3ca
This commit is contained in:
Jesse Pretorius 2018-08-25 21:18:42 +01:00
parent 0e753b0c63
commit 4f1db03d96
4 changed files with 1 additions and 25 deletions

View File

@ -84,11 +84,6 @@
name: it_does_not_matter name: it_does_not_matter
daemon_reload: yes daemon_reload: yes
- name: Remove generated apt keys from LXC host
file:
path: /root/repo.keys
state: absent
- name: Remove rootfs archive - name: Remove rootfs archive
file: file:
path: "/tmp/{{ cache_basename }}" path: "/tmp/{{ cache_basename }}"

View File

@ -69,23 +69,6 @@
to ensure they're available otherwise disable the quota system by to ensure they're available otherwise disable the quota system by
setting `lxc_host_machine_quota_disabled` to true. setting `lxc_host_machine_quota_disabled` to true.
- block:
- name: Generate apt keys from LXC host for the container cache
shell: "apt-key exportall"
changed_when: false
register: _apt_exportall
tags:
- skip_ansible_lint
- name: Write exported keys to temporary file
copy:
content: "{{ _apt_exportall.stdout }}"
dest: "/root/repo.keys"
notify:
- Remove generated apt keys from LXC host
when:
- ansible_pkg_mgr == 'apt'
# NOTE(cloudnull): We're using rsync and an if block because we've no means # NOTE(cloudnull): We're using rsync and an if block because we've no means
# to loop over a block. Re-evaluate this task when/if this is # to loop over a block. Re-evaluate this task when/if this is
# merged https://github.com/ansible/ansible/issues/13262 # merged https://github.com/ansible/ansible/issues/13262

View File

@ -5,8 +5,6 @@ set -e -x
{% include 'templates/prep-scripts/_container_sys_setup.sh.j2' %} {% include 'templates/prep-scripts/_container_sys_setup.sh.j2' %}
apt-key add -v /root/repo.keys
rm /root/repo.keys
export DEBIAN_FRONTEND=noninteractive export DEBIAN_FRONTEND=noninteractive
apt-get remove -y --purge snap* lxc* lxd* resolvconf* || true apt-get remove -y --purge snap* lxc* lxd* resolvconf* || true

View File

@ -22,10 +22,10 @@ _lxc_cache_map:
copy_from_host: copy_from_host:
- /etc/apt/sources.list - /etc/apt/sources.list
- /etc/apt/apt.conf.d/ - /etc/apt/apt.conf.d/
- /etc/apt/trusted.gpg.d
- /etc/apt/preferences.d/ - /etc/apt/preferences.d/
- /etc/environment - /etc/environment
- /etc/localtime - /etc/localtime
- /root/repo.keys
- /etc/protocols - /etc/protocols
_lxc_cache_prep_template: "prep-scripts/ubuntu_16_prep.sh.j2" _lxc_cache_prep_template: "prep-scripts/ubuntu_16_prep.sh.j2"