apt_key problem on Ubuntu?

1,685 views
Skip to first unread message

Frans Kuipers

unread,
May 23, 2013, 10:03:56 AM5/23/13
to ansible...@googlegroups.com
In my playbook I have the action:
  apt_key: url=https://keyserver.ubuntu.com id=0xcbcb082a1bb943db state=present

It times out on: File \"/home/vagrant/.ansible/tmp/ansible-1369317219.32-261093913648844/apt_key\", line 104, in download_key

When I use this action:
  command: apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db

Is is working well, but then it is always state=changed.

Am I doing something wrong in the apt_key parameters (the examples are for debian), or is it not working on Ubuntu (12.04)?

-- Frans

Michael DeHaan

unread,
May 23, 2013, 10:09:26 AM5/23/13
to ansible...@googlegroups.com
What version of Ansible are you using and can you please paste the full output of running the apt_key module?

(The command module is going to return state=changed every time, since you didn't supply creates= nor removes=.  That's working fine)






-- Frans

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Serge van Ginderachter

unread,
May 23, 2013, 10:15:38 AM5/23/13
to ansible...@googlegroups.com

On 23 May 2013 16:03, Frans Kuipers <fransk...@gmail.com> wrote:
  apt_key: url=https://keyserver.ubuntu.com id=0xcbcb082a1bb943db state=present

It times out on: File \"/home/vagrant/.ansible/tmp/ansible-1369317219.32-261093913648844/apt_key\", line 104, in download_key

​Are you sure about that http url? I'm also getting a timeout​ browsing to it. AFAICS they don't support secure http

Also, on the top of my head, I think you need to point the full url to the key you need:
e.g.:


The id is only used to check if the key is already present, not to download it.


Serge

Frans Kuipers

unread,
May 23, 2013, 11:02:48 AM5/23/13
to ansible...@googlegroups.com
Thanks both for your replies.

I am using ansible 1.2 (development branch from 2 days ago).

Thanks Serge, your reply enalble me to solve my problem. The keyserver.ubuntu.com doesn't support https.

This is working for me now:

I tried it with 
  apt_key: url=http://keyserver.ubuntu.com id=0xCBCB082A1BB943DB state=present 

But then the error is: 
TASK: [General | Install mariaDB apt key.] ************************************ 
failed: [drupal7.vm3.local] => {"cmd": "apt-key add -", "failed": true, "item": "", "rc": 2}
stderr: gpg: no valid OpenPGP data found.

msg: gpg: no valid OpenPGP data found.

FATAL: all hosts have already failed -- aborting  

My problem is solved, thanks!
-- Frans



Reply all
Reply to author
Forward
0 new messages