On Mon, Oct 17, 2016 at 02:59:43PM +0200, Sebastien Marie wrote:
> Hi,
>
> With the latest update of ansible (ansible-2.1.2.0->2.1.2.0p3), I
> experiment failure in the use of `openbsd_pkg' module.
>
> The exception occurs when specifying a package name without version or
> branch (like juste "sysclean"). The code will assume branch syntax and
> will fail at extracting branch information after '%'.
>
> As workaround it works with explicitly specifying the version-less name
> (like "sysclean--").
>
>
> $ doas ansible -vvv localhost -m openbsd_pkg -a 'name=sysclean state=present'
> Using /etc/ansible/ansible.cfg as config file
> [WARNING]: provided hosts list is empty, only localhost is available
>
> <127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: semarie
> <127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo
> $HOME/.ansible/tmp/ansible-tmp-1476708883.67-184353742364685 `" && echo
> ansible-tmp-1476708883.67-184353742364685="` echo
> $HOME/.ansible/tmp/ansible-tmp-1476708883.67-184353742364685 `" ) && sleep 0'
> <127.0.0.1> PUT /tmp/tmp8ykgP0 TO
> /home/semarie/.ansible/tmp/ansible-tmp-1476708883.67-184353742364685/openbsd_pkg
> <127.0.0.1> EXEC /bin/sh -c 'chmod u+x
> /home/semarie/.ansible/tmp/ansible-tmp-1476708883.67-184353742364685/
> /home/semarie/.ansible/tmp/ansible-tmp-1476708883.67-184353742364685/openbsd_pkg
> && sleep 0'
> <127.0.0.1> EXEC /bin/sh -c 'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8
> LC_MESSAGES=en_US.UTF-8 /usr/local/bin/python2.7
> /home/semarie/.ansible/tmp/ansible-tmp-1476708883.67-184353742364685/openbsd_pkg;
> rm -rf
> "/home/semarie/.ansible/tmp/ansible-tmp-1476708883.67-184353742364685/" >
> /dev/null 2>&1 && sleep 0'
> An exception occurred during task execution. The full traceback is:
> Traceback (most recent call last):
> File "/tmp/ansible_t2obkK/ansible_module_openbsd_pkg.py", line 512, in
> <module>
> main()
> File "/tmp/ansible_t2obkK/ansible_module_openbsd_pkg.py", line 487, in main
> parse_package_name(name, pkg_spec, module)
> File "/tmp/ansible_t2obkK/ansible_module_openbsd_pkg.py", line 358, in
> parse_package_name
> pkg_spec['branch'] = pkg_spec['stem'].split('%')[1]
> IndexError: list index out of range
>
> localhost | FAILED! => {
> "changed": false,
> "failed": true,
> "invocation": {
> "module_name": "openbsd_pkg"
> },
> "module_stderr": "Traceback (most recent call last):\n File
> \"/tmp/ansible_t2obkK/ansible_module_openbsd_pkg.py\", line 512, in
> <module>\n main()\n File
> \"/tmp/ansible_t2obkK/ansible_module_openbsd_pkg.py\", line 487, in main\n
> parse_package_name(name, pkg_spec, module)\n File
> \"/tmp/ansible_t2obkK/ansible_module_openbsd_pkg.py\", line 358, in
> parse_package_name\n pkg_spec['branch'] =
> pkg_spec['stem'].split('%')[1]\nIndexError: list index out of range\n",
> "module_stdout": "",
> "msg": "MODULE FAILURE"
> }
>
> --
> Sebastien Marie
Does this also happen when you remove the two '-z' parts of the local patch we
carry for ansible? I don't have a CVS tree around right now to provide you with
a patch to apply.
--
jasper