Hi Daniel,

I can see that the collection paths are also set to a non-existing directory, but I can't reproduce the actual error of collection filters being unavailable. FWIW, here is a reproducer that shows that it works:


$ cat collections_path_test.yml
- hosts: localhost
  tasks:
    - name: Convert a duration into days
      ansible.builtin.debug:
        msg: "{{ '1y 7m 5d 30h' | community.general.to_days }}"
$ ansible-playbook collections_path_test.yml
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'

PLAY [localhost] **********************************************************************************************************************************************************************************************************************

TASK [Gathering Facts] ****************************************************************************************************************************************************************************************************************
ok: [localhost]

TASK [Convert a duration into days] ***************************************************************************************************************************************************************************************************
ok: [localhost] =>
    msg: 371.254861111111

PLAY RECAP **************************************************************************************************************************************************************************************************************************** localhost : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0

$ ls -l /usr/share/ansible/collections
ls: cannot access '/usr/share/ansible/collections': No such file or directory
$ ansible-config dump | grep COLLECTIONS_PATHS
COLLECTIONS_PATHS(default) = ['/home/randall/.ansible/collections', '/usr/share/ansible/collections']

$ ansible-doc -t filter community.general.to_days
> FILTER community.general.to_days (/usr/lib/python3/dist-packages/ansible_collections/community/general/plugins/filter/to_days.yml)

  Parse a human readable time duration string and convert to days.

OPTIONS (red indicates it is required):

   _input  The time string to convert.
Can use the units `y' and `year' for a year, `mo' and `month' for a month, `w' and `week' for a week, `d' and `day' for a day, `h' and `hour' for a hour, `m', `min' and `minute' for minutes, `s', `sec' and `second' for seconds, `ms', `msec', `msecond' and `millisecond' for milliseconds. The suffix `s' can be added to a unit as well, so
           `seconds' is the same as `second'.
Valid strings are space separated combinations of an integer with an optional minus sign and a unit.
           Examples are `1h', `-5m', and `3h -5m 6s'.
        type: string

   month   Number of days per month.
        default: 30
        type: float

   year    Number of days per year.
        default: 365
        type: float

AUTHOR: René Moser (@resmo)

NAME: to_days

EXAMPLES:
- name: Convert a duration into days
  ansible.builtin.debug:
    msg: "{{ '1y 7m 5d 30h' | community.general.to_days }}"

RETURN VALUES:

   _value  Number of days.
        type: float


So the community.general.to_days filter works for me. Can you show me a minimal reproducer of the issue?

Greets,
Lee

On 27/07/2025 22:38, Daniel Leidert wrote:
Package: ansible
Version: 12.0.0~b1+dfsg-1
Severity: important

The collections path seems to be incorrect:

$ ansible-config dump | grep COLLECTIONS_PATHS
COLLECTIONS_PATHS(default) = ['/home/user/.ansible/collections', 
'/usr/share/ansible/collections']

$ ls -lA /usr/share/ansible/collections
ls: cannot access '/usr/share/ansible/collections': No such file or directory

Indeed, the collections seem to be under
/usr/lib/python3/dist-packages/ansible_collections/

Thus, filters are failing here right now because they cannot be found.

Regards, Daniel

-- System Information:
Debian Release: 13.0
   APT prefers testing-security
   APT policy: (500, 'testing-security'), (500, 'stable-security'), (500, 
'oldstable-security'), (500, 'unstable'), (500, 'testing'), (500, 'stable'), 
(500, 'oldstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 6.12.38+deb13-amd64 (SMP w/16 CPU threads; PREEMPT)
Kernel taint flags: TAINT_OOT_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages ansible depends on:
ii  ansible-core       2.19.0-1
ii  openssh-client     1:10.0p1-5
ii  python3            3.13.5-1
ii  python3-dnspython  2.7.0-1
ii  python3-httplib2   0.22.0-1
ii  python3-jinja2     3.1.6-1
ii  python3-netaddr    1.3.0-1
ii  python3-paramiko   3.5.1-3
ii  python3-yaml       6.0.2-1+b2

Versions of packages ansible recommends:
ii  python3-argcomplete   3.6.2-1
ii  python3-cryptography  43.0.0-3
ii  python3-jmespath      1.0.1-1
ii  python3-kerberos      1.1.14-3.1+b11
ii  python3-libcloud      3.8.0+repack-4
ii  python3-selinux       3.8.1-1
ii  python3-winrm         0.5.0-2
ii  python3-xmltodict     0.13.0-1

Versions of packages ansible suggests:
pn  cowsay   <none>
pn  sshpass  <none>

-- no debconf information



Reply via email to