Skip to content
Advertisement

How can I add a PPA repository using Ansible?

I’m trying to add a new repository to a server so that I can install Java by Ansible. Unfortunately whenever I try to run the playbook it fails because of a GPG error. Can somebody explain what is going wrong here and what I need to do in order to fix this?

I’m using Ansible 1.7.2 and currently only connecting to localhost.

I have a very simple Playbook that looks like this:

JavaScript

When I try to execute it, I get the following error:

JavaScript

Advertisement

Answer

Oh, this seems to have been entirely caused by me forgetting the -s option!

Without this it wasn’t using sudo.

Advertisement