# apt\_key with ubuntu trusty

**URL:** <https://forum.ansible.com/t/apt-key-with-ubuntu-trusty/17421>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [February 2, 2015, 6:29pm UTC](https://forum.ansible.com/t/apt-key-with-ubuntu-trusty/17421 "2015-02-02T18:29:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rogelio\_Morrell](https://avatars.discourse-cdn.com/v4/letter/r/ecae2f/32.png) [@Rogelio\_Morrell](https://forum.ansible.com/u/Rogelio_Morrell)\
**Post date:** [February 2, 2015, 6:29pm UTC](https://forum.ansible.com/t/apt-key-with-ubuntu-trusty/17421/1 "2015-02-02T18:29:36Z")

</div>

Hi,

Using Ansible 1.6.6 and a Linux Mint 16, which tries to provision an Ubuntu trusty image, I get apt\_key error

---

<div class="post-metadata">

**Author:** ![Giovanni\_Tirloni](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@Giovanni\_Tirloni](https://forum.ansible.com/u/Giovanni_Tirloni)\
**Post date:** [February 2, 2015, 6:55pm UTC](https://forum.ansible.com/t/apt-key-with-ubuntu-trusty/17421/2 "2015-02-02T18:55:56Z")

</div>

> failed: [default] =\> {"failed": true, "id":  
> "3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"}  
> msg: key does not seem to have been added

[...]

> - name: Get Xamarin GPG  
> # Add an apt key by id from a keyserver  
> &nbsp;&nbsp;apt\_key: keyserver=keyserver.ubuntu.com  
> id=3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF state=present

Checking the apt\_key code, it seems the function that imports the key  
always return True [1]... but I suspect the apt-key command might be  
failing.

Does it work if you try to import the key manually?

apt-key adv --keyserver keyserver.ubuntu.com --recv  
3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF

[1]  
[https://github.com/ansible/ansible-modules-core/blob/devel/packaging/os/apt\_key.py](https://github.com/ansible/ansible-modules-core/blob/devel/packaging/os/apt_key.py)
