# apt\_key hanging issues

**URL:** <https://forum.ansible.com/t/apt-key-hanging-issues/26925>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [March 7, 2018, 8:16pm UTC](https://forum.ansible.com/t/apt-key-hanging-issues/26925 "2018-03-07T20:16:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Jones](https://avatars.discourse-cdn.com/v4/letter/d/a87d85/32.png) [@David\_Jones](https://forum.ansible.com/u/David_Jones)\
**Post date:** [March 7, 2018, 8:16pm UTC](https://forum.ansible.com/t/apt-key-hanging-issues/26925/1 "2018-03-07T20:16:45Z")

</div>

Hi I am stuck trying to get apt\_key to download a key from a key server.

Here is my code which just hags indefinitely.

- name: Get upstream APT GPG key  
apt\_key:  
id: “{{ docker\_apt\_key }}”  
keyserver: “{{ key\_server }}”  
state: “present”

Here are my vars…

docker\_apt\_key: “9DC858229FC7DD38854AE2D88D81803C0EBFCD88”  
key\_server: “[keyserver.ubuntu.com](http://keyserver.ubuntu.com)”

This script is created on the host.

/tmp/.ansible/tmp/ansible-tmp-1520452202.6258628-133739762258932/apt\_key.py

When I run it manually with the verbosity turned up, I can see that it hangs after this line…

# code object from ‘/usr/lib/python3.4/encodings/ **pycache** /cp437.cpython-34.pyc’

import ‘encodings.cp437’ # \<\_frozen\_importlib.SourceFileLoader object at 0x7ff409266828\>

Any suggestions?

Thanks,

David
