DataDog/ansible-datadog

Opening for visibility: service_facts broken in Ubuntu 20.04

rromanchuk opened this issue ยท 6 comments

Hi @rromanchuk,

Thanks for reporting this! We'll add a note in the README about this issues and how to fix it by upgrading Ansible (once the mentioned fix is released).

Any updates? I have the same issue.

enys commented

I can confirm this has been fixed. You only need to upgrade your version of ansible

I can confirm this has been fixed. You only need to upgrade your version of ansible

Hi, could you kindly confirm which version you need to upgrade to? I still seem to get this issue on the latest (apt) install of ansible on focal 20.04, and the PPA still does not appear to have a focal release so I would consider this the latest release as per the install instructions on the Ansible website for Ubuntu.

Thanks in advance!!

neil@desk:~$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.1 LTS
Release:	20.04
Codename:	focal

neil@desk:~$ ansible --version
ansible 2.9.6
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/neil/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.8.5 (default, Jul 28 2020, 12:59:40) [GCC 9.3.0]

neil@desk:~$ ansible -m service_facts localhost
localhost | FAILED! => {
    "changed": false,
    "msg": "Malformed output discovered from systemd list-unit-files: accounts-daemon.service                    enabled         enabled      "
}

I replicate the error described by neilee.

Just to update, this looks like it's fixed when you install ansible via pip (pip3 install ansible) instead of apt. The version in the focal repo needs to be updated.

As at 2020.10.28:

  • Version installed using apt: 2.9.6
  • Version installed by pip3: 2.10.2

So it's obviously been fixed after version 2.9.6.

cp -r /etc/ansible /etc/ansible.old
apt purge ansible
apt install python3-pip
pip3 install ansible

neil@desk:~$ ansible -m service_facts localhost | tail
            "xfs_scrub_fail@.service": {
                "name": "xfs_scrub_fail@.service",
                "source": "systemd",
                "state": "unknown",
                "status": "static"
            }
        }
    },
    "changed": false
}