# apt-key with HKP keyserver

**URL:** <https://forum.ansible.com/t/apt-key-with-hkp-keyserver/14677>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [February 28, 2014, 8:03pm UTC](https://forum.ansible.com/t/apt-key-with-hkp-keyserver/14677 "2014-02-28T20:03:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Mahemoff](https://avatars.discourse-cdn.com/v4/letter/m/5f9b8f/32.png) [@Michael\_Mahemoff](https://forum.ansible.com/u/Michael_Mahemoff)\
**Post date:** [February 28, 2014, 8:03pm UTC](https://forum.ansible.com/t/apt-key-with-hkp-keyserver/14677/1 "2014-02-28T20:03:05Z")

</div>

I’m trying to follow the instructions for installing MaraDB apt package ([https://downloads.mariadb.org/mariadb/repositories/#distro=Ubuntu&distro\_release=precise&version=5.5](https://downloads.mariadb.org/mariadb/repositories/#distro=Ubuntu&distro_release=precise&version=5.5)). It proposes to add a key like this:

`sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db`

`So I tried this in the playbook:`

`apt_key: keyserver="hkp://keyserver.ubuntu.com:80" id=0xcbcb082a1bb943db state=present`

`And got the error "`urlopen error unknown url type: hkp". Have I used the right syntax?

---

<div class="post-metadata">

**Author:** ![Adam\_Morris](https://avatars.discourse-cdn.com/v4/letter/a/ecae2f/32.png) [@Adam\_Morris](https://forum.ansible.com/u/Adam_Morris)\
**Post date:** [March 1, 2014, 6:10am UTC](https://forum.ansible.com/t/apt-key-with-hkp-keyserver/14677/2 "2014-03-01T06:10:50Z")

</div>

Yes, you did it right…

But I’d try changing hkp (http keyserver protocol) to http…

I’ve had similar issues with hkp before.

Adam

---

<div class="post-metadata">

**Author:** ![Michael\_Mahemoff](https://avatars.discourse-cdn.com/v4/letter/m/5f9b8f/32.png) [@Michael\_Mahemoff](https://forum.ansible.com/u/Michael_Mahemoff)\
**Post date:** [March 1, 2014, 8:58am UTC](https://forum.ansible.com/t/apt-key-with-hkp-keyserver/14677/3 "2014-03-01T08:58:47Z")

</div>

http doesn’t work stderr: gpg: no valid OpenPGP data found."

Maybe I should report it as a bug?

---

<div class="post-metadata">

**Author:** ![Adrian\_Simmons](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@Adrian\_Simmons](https://forum.ansible.com/u/Adrian_Simmons)\
**Post date:** [May 13, 2014, 2:53pm UTC](https://forum.ansible.com/t/apt-key-with-hkp-keyserver/14677/4 "2014-05-13T14:53:38Z")

</div>

Did you ever resolve this Michael? Just hit the same OpenPGP error with MariaDB…

---

<div class="post-metadata">

**Author:** ![Taylor\_Brown](https://avatars.discourse-cdn.com/v4/letter/t/e9bcb4/32.png) [@Taylor\_Brown](https://forum.ansible.com/u/Taylor_Brown)\
**Post date:** [December 5, 2014, 4:55pm UTC](https://forum.ansible.com/t/apt-key-with-hkp-keyserver/14677/5 "2014-12-05T16:55:17Z")

</div>

I’m getting the same errors with an hkp server when trying to install rmv’s gpg key.
