Hi Axel,
does this issue still persist for you? Looking up the code it seems as
though there's now a heuristic in place that should fall back to other
methods if dbus is unavailable.
Greets,
Lee
On Thu, 13 Jul 2017 23:00:34 +0200 Axel Beckert <[email protected]> wrote:
Package: ansible
Version: 2.2.1.0-2
Control: forwarded -1 https://github.com/ansible/ansible/issues/25543
Dear Maintainer,
the following trivial task fails if dbus is not installed on a remote
machine (e.g. a server):
- name: Set the hostname
hostname:
name: "{{ ansible_host }}"
It fails as follows despite dbus is (obviously) not necessary to set the
hostname under Linux:
fatal: […]: FAILED! => {"changed": false, "failed": true, "msg": "Command failed
rc=1, out=, err=Failed to create bus connection: Connection refused\n"}
If dbus is installed on the remote machine, the module works
fine. According to the upstream bug report at
https://github.com/ansible/ansible/issues/25543 this only happens with
systemd as init system (or at least if systemd is installed and dbus is
not).
-- System Information:
Debian Release: 9.0
APT prefers stable-debug
APT policy: (500, 'stable-debug'), (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 4.9.0-3-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8),
LANGUAGE=en_US:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
Versions of packages ansible depends on:
ii python 2.7.13-2
ii python-crypto 2.6.1-7
ii python-httplib2 0.9.2+dfsg-1
ii python-jinja2 2.8-1
ii python-netaddr 0.7.18-2
ii python-paramiko 2.0.0-1
ii python-pkg-resources 33.1.1-1
ii python-yaml 3.12-1
Versions of packages ansible recommends:
ii python-kerberos 1.1.5-2+b2
ii python-selinux 2.6-3+b1
pn python-winrm <none>
ii python-xmltodict 0.10.2-1
Versions of packages ansible suggests:
ii cowsay 3.03+dfsg2-3
ii sshpass 1.06-1
-- no debconf information