Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ansible installation of Debian packages

Tags:

ansible

I'm trying to install a Debian package via Ansible apt task:

   - name: Install prince
     apt:
         deb: http://www.princexml.com/download/prince_11-1_debian8.0_amd64.deb

However, I get the message:

SystemError:
E:Could not open file http://www.princexml.com/download/prince_11-1_debian8.0_amd64.deb - open (2: No such file or directory),
E:Unable to determine file size for fd -1 - fstat (9: Bad file descriptor),
E:Read error - read (9: Bad file descriptor)

The URL is valid. I can download to my local, using that link. I can install using dpkg -i. However that ansible task doesn't work. Thanks in advance.

like image 521
Arun Avatar asked Dec 21 '16 20:12

Arun


2 Answers

Take care with the spaces in yml format should be like this:

  - name: Install prince
    apt:
      deb: http://www.princexml.com/download/prince_11-1_debian8.0_amd64.deb
like image 82
Juan Antonio Avatar answered Oct 20 '22 04:10

Juan Antonio


The docs for the apt module state that when the deb contains :// it'll try and download the package. This was added with Ansible 2.1

So, I assume you are using an ansible version before 2.1

like image 29
dgw Avatar answered Oct 20 '22 03:10

dgw