Merge "Simplify inserting apt keys into nspawn image"
This commit is contained in:
commit
67dbe197a8
@ -52,8 +52,3 @@
|
||||
- name: Reload systemd-daemon
|
||||
systemd:
|
||||
daemon_reload: true
|
||||
|
||||
- name: Remove generated apt keys
|
||||
file:
|
||||
path: /root/repo.keys
|
||||
state: absent
|
||||
|
@ -66,21 +66,6 @@
|
||||
when:
|
||||
- nspawn_image_cache_refresh | bool
|
||||
|
||||
- block:
|
||||
- name: Generate apt keys from host for the container cache
|
||||
command: "apt-key exportall"
|
||||
changed_when: false
|
||||
register: _apt_exportall
|
||||
|
||||
- name: Write exported keys to file
|
||||
copy:
|
||||
content: "{{ _apt_exportall.stdout }}"
|
||||
dest: "/var/lib/machines/{{ nspawn_container_base_name }}/root/repo.keys"
|
||||
notify:
|
||||
- Remove generated apt keys
|
||||
when:
|
||||
- ansible_pkg_mgr == 'apt'
|
||||
|
||||
- name: Cached image preparation script
|
||||
template:
|
||||
src: "prep-scripts/nspawn_{{ nspawn_cache_map.distro }}_prep.sh.j2"
|
||||
|
@ -30,14 +30,6 @@ apt-get update
|
||||
|
||||
apt-get install -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" --force-yes {{ nspawn_container_distro_required_packages | join(' ') }}
|
||||
|
||||
#start gpg-agent if is is not already running
|
||||
<(gpg-agent) || true
|
||||
gpg-connect-agent /bye || true
|
||||
|
||||
if [[ -f "/root/repo.keys" ]]; then
|
||||
apt-key add /root/repo.keys
|
||||
fi
|
||||
|
||||
apt-get install -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" --force-yes {{ nspawn_container_distro_packages | join(' ') }}
|
||||
apt-get upgrade -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" --force-yes
|
||||
apt-get clean
|
||||
|
@ -63,3 +63,4 @@ _nspawn_copy_from_host:
|
||||
- /etc/apt/sources.list
|
||||
- /etc/apt/apt.conf.d/
|
||||
- /etc/apt/preferences.d/
|
||||
- /etc/apt/trusted.gpg.d
|
||||
|
@ -63,3 +63,4 @@ _nspawn_copy_from_host:
|
||||
- /etc/apt/sources.list
|
||||
- /etc/apt/apt.conf.d/
|
||||
- /etc/apt/preferences.d/
|
||||
- /etc/apt/trusted.gpg.d
|
||||
|
Loading…
Reference in New Issue
Block a user