Error installing Java on virtual machine

2

I'm trying to run a playbook (ansible-playbook -i hosts.ini file.yml ) that installs java on my virtual machine, but it throws an error in the installation task:

  

FAILED! = > {"changed": false, "cmd": "apt-key add -", "failed": true,   "msg": "gpg: no valid OpenPGP data found.", "rc": 2, "stderr": "gpg:   not valid OpenPGP data found. \ n "," stdout ":" "," stdout_lines ": []}

The .yml file for this task looks like this:

 name: Add the webupd8 APT repository key
  tags:
    - java
    - java-webupd8
  apt_key: data="{{ lookup('file', 'webupd8.key.asc') }}" state=present
  # Use a static file because right now using just an ID fails

- name: Add the webupd8 APT repository
  tags:
    - java
    - java-webupd8
  apt_repository: repo="deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" state=present

PS: I'm newbie in the provisioning of virtual machines and the like.

    
asked by anonymous 18.10.2016 / 11:37

0 answers