# Ansible on OpenBSD - failures in 'package' module

**URL:** <https://forum.ansible.com/t/ansible-on-openbsd-failures-in-package-module/23148>\
**Category:** Ansible Project\
**Created:** [December 1, 2016, 5:18am UTC](https://forum.ansible.com/t/ansible-on-openbsd-failures-in-package-module/23148 "2016-12-01T05:18:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Darren\_S](https://avatars.discourse-cdn.com/v4/letter/d/59ef9b/32.png) [@Darren\_S](https://forum.ansible.com/u/Darren_S)\
**Post date:** [December 1, 2016, 5:18am UTC](https://forum.ansible.com/t/ansible-on-openbsd-failures-in-package-module/23148/1 "2016-12-01T05:18:55Z")

</div>

Ansible manager: OpenBSD 5.7, Python 2.7.9, Ansible 2.2.0.0  
Managed host: OpenBSD 6.0 (RELEASE), Python 2.7.12

Using 'package' module on OpenBSD 6.0 appears to fail.

Running this task:

- name: install common packages  
&nbsp;&nbsp;package:  
&nbsp;&nbsp;&nbsp;&nbsp;name: "{{ item }}"  
&nbsp;&nbsp;&nbsp;&nbsp;state: present  
&nbsp;&nbsp;with\_items:  
&nbsp;&nbsp;&nbsp;- bzip2  
&nbsp;&nbsp;&nbsp;- curl  
&nbsp;&nbsp;&nbsp;- git  
&nbsp;&nbsp;&nbsp;- gmake  
&nbsp;&nbsp;&nbsp;- lsof  
&nbsp;&nbsp;&nbsp;- pkglocatedb  
&nbsp;&nbsp;&nbsp;- pstree  
&nbsp;&nbsp;&nbsp;- python%2.7  
&nbsp;&nbsp;&nbsp;- py-pip  
&nbsp;&nbsp;&nbsp;- tcpflow  
&nbsp;&nbsp;&nbsp;- tcptraceroute  
&nbsp;&nbsp;tags: [packages]

...errors with the following:

TASK [openbsd\_common : install common packages] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

failed: [molodetz-new] (item=[u'bzip2', u'curl', u'git', u'gmake',  
u'lsof', u'pkglocatedb', u'pstree', u'python%2.7', u'py-pip',  
u'tcpflow', u'tcptraceroute']) =\> {"failed": true, "item": ["bzip2",  
"curl", "git", "gmake", "lsof", "pkglocatedb", "pstree", "python%2.7",  
"py-pip", "tcpflow", "tcptraceroute"], "msg": "failed in  
get\_package\_state(): Error from  
[http://ftp5.usa.openbsd.org/pub/OpenBSD/6.0/packages/amd64/curl,.tgz\\nftp:](http://ftp5.usa.openbsd.org/pub/OpenBSD/6.0/packages/amd64/curl,.tgz%5C%5Cnftp:)  
Error retrieving file: 404 Not Found\nError from  
[http://ftp5.usa.openbsd.org/pub/OpenBSD/6.0/packages/amd64/curl,.tgz\\nftp:](http://ftp5.usa.openbsd.org/pub/OpenBSD/6.0/packages/amd64/curl,.tgz%5C%5Cnftp:)  
Error retrieving file: 404 Not Found\nError from  
[http://ftp5.usa.openbsd.org/pub/OpenBSD/6.0/packages/amd64/git,.tgz\\nftp:](http://ftp5.usa.openbsd.org/pub/OpenBSD/6.0/packages/amd64/git,.tgz%5C%5Cnftp:)  
Error retrieving file: 404 Not Found\nError from  
[http://ftp5.usa.openbsd.org/pub/OpenBSD/6.0/packages/amd64/gmake,.tgz\\nftp:](http://ftp5.usa.openbsd.org/pub/OpenBSD/6.0/packages/amd64/gmake,.tgz%5C%5Cnftp:)  
Error retrieving file: 404 Not Found\nError from  
[http://ftp5.usa.openbsd.org/pub/OpenBSD/6.0/packages/amd64/lsof,.tgz\\nftp:](http://ftp5.usa.openbsd.org/pub/OpenBSD/6.0/packages/amd64/lsof,.tgz%5C%5Cnftp:)  
Error retrieving file: 404 Not Found\nError from  
[http://ftp5.usa.openbsd.org/pub/OpenBSD/6.0/packages/amd64/pkglocatedb,.tgz\\nftp:](http://ftp5.usa.openbsd.org/pub/OpenBSD/6.0/packages/amd64/pkglocatedb,.tgz%5C%5Cnftp:)  
Error retrieving file: 404 Not Found\nError from  
[http://ftp5.usa.openbsd.org/pub/OpenBSD/6.0/packages/amd64/pstree,.tgz\\nftp:](http://ftp5.usa.openbsd.org/pub/OpenBSD/6.0/packages/amd64/pstree,.tgz%5C%5Cnftp:)  
Error retrieving file: 404 Not Found\nError from  
[http://ftp5.usa.openbsd.org/pub/OpenBSD/6.0/packages/amd64/python%2\.7,\.tgz\\nftp:](http://ftp5.usa.openbsd.org/pub/OpenBSD/6.0/packages/amd64/python%252%5C.7,%5C.tgz%5C%5Cnftp:)  
Error retrieving file: 404 Not Found\nError from  
[http://ftp5.usa.openbsd.org/pub/OpenBSD/6.0/packages/amd64/python%2\.7,\.tgz\\nftp:](http://ftp5.usa.openbsd.org/pub/OpenBSD/6.0/packages/amd64/python%252%5C.7,%5C.tgz%5C%5Cnftp:)  
Error retrieving file: 404 Not Found\nError from  
[http://ftp5.usa.openbsd.org/pub/OpenBSD/6.0/packages/amd64/py-pip,.tgz\\nftp:](http://ftp5.usa.openbsd.org/pub/OpenBSD/6.0/packages/amd64/py-pip,.tgz%5C%5Cnftp:)  
Error retrieving file: 404 Not Found\nError from  
[http://ftp5.usa.openbsd.org/pub/OpenBSD/6.0/packages/amd64/tcpflow,.tgz\\nftp:](http://ftp5.usa.openbsd.org/pub/OpenBSD/6.0/packages/amd64/tcpflow,.tgz%5C%5Cnftp:)  
Error retrieving file: 404 Not Found\n"}

It looks like the package URL gets mangled, and errors are reported  
from all packages in the list except the first (bzip2) and last  
(tcptraceroute). I also don't totally know why the python%2.7 package  
is attempted twice in there (the %2.7 specification by the way means  
to install the package with that "branch", which is how the package  
manager can distinguish between e.g. python 2.x and 3.x packages).

The above occurs when using the 'package' module. When using the  
'openbsd\_pkg' module this succeeds:

TASK [openbsd\_common : install common packages] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

ok: [molodetz-new] =\> (item=bzip2)  
ok: [molodetz-new] =\> (item=curl)  
ok: [molodetz-new] =\> (item=git)  
ok: [molodetz-new] =\> (item=gmake)  
changed: [molodetz-new] =\> (item=lsof)  
ok: [molodetz-new] =\> (item=pkglocatedb)  
changed: [molodetz-new] =\> (item=pstree)  
ok: [molodetz-new] =\> (item=python%2.7)  
ok: [molodetz-new] =\> (item=py-pip)  
ok: [molodetz-new] =\> (item=tcpflow)  
ok: [molodetz-new] =\> (item=tcptraceroute)

Is there a mistake in the task configuration that affects the package  
module? Should the package module pass off to the openbsd\_pkg module  
internally?

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [December 1, 2016, 2:33pm UTC](https://forum.ansible.com/t/ansible-on-openbsd-failures-in-package-module/23148/2 "2016-12-01T14:33:33Z")

</div>

This is fixed in devel and stable branches and should go out in the next releases.

As a workaround set squash\_actions in ansible.cfg:

squash\_actions=[“apk, apt, dnf, homebrew, pacman, pkgng, yum, zypper”]
