+
Skip to content

acl only tries nfs4_* tools even on platforms that have a NFSv4 set/getfacl #651

@signed-log

Description

@signed-log
SUMMARY

On platforms like FreeBSD, the nfs4_setfacl/nfs4_getfacl do not exist which makes acl edits fail.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

acl

ANSIBLE VERSION
ansible [core 2.18.6]
  config file = /home/signed/dev/docker/dep/ansible_playbooks/ansible.cfg
  configured module search path = ['/home/signed/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/signed/dev/docker/.venv/lib/python3.12/site-packages/ansible
  ansible collection location = /home/signed/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/signed/dev/docker/.venv/bin/ansible
  python version = 3.12.11 (main, Jun 12 2025, 12:40:51) [Clang 20.1.4 ] (/home/signed/dev/docker/.venv/bin/python)
  jinja version = 3.1.6
  libyaml = True
COLLECTION VERSION
# /home/signed/dev/docker/.venv/lib/python3.12/site-packages/ansible_collections
Collection    Version
------------- -------
ansible.posix 1.6.2
CONFIGURATION
ANSIBLE_NOCOWS(/home/signed/dev/docker/dep/ansible_playbooks/ansible.cfg) = True
CONFIG_FILE() = /home/signed/dev/docker/dep/ansible_playbooks/ansible.cfg
DEFAULT_FORKS(/home/signed/dev/docker/dep/ansible_playbooks/ansible.cfg) = 16
DEFAULT_JINJA2_NATIVE(/home/signed/dev/docker/dep/ansible_playbooks/ansible.cfg) = True
EDITOR(env: EDITOR) = nvim
ENABLE_TASK_DEBUGGER(/home/signed/dev/docker/dep/ansible_playbooks/ansible.cfg) = True

GALAXY_SERVERS:
OS / ENVIRONMENT

FreeBSD 14.2

STEPS TO REPRODUCE
    - name: Allow ZFS to be mounted by {{ item.user }}
      ansible.posix.acl:
        path: "/{{ item.name }}"
        entity: "{{ item.nas_user }}"
        etype: user
        permissions: aD
        state: present
        use_nfsv4_acls: true
      loop: "{{ zfs_permissions }}"
      when: "'mount' in (item.perms | default([]))"
EXPECTED RESULTS

It using the correct executable for BSD platforms

ACTUAL RESULTS
The full traceback is:
  File "/tmp/ansible_ansible.posix.acl_payload_smbtytp7/ansible_ansible.posix.acl_payload.zip/ansible/module_utils/basic.py", line 1365, in get_bin_path
    bin_path = get_bin_path(arg=arg, opt_dirs=opt_dirs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/ansible_ansible.posix.acl_payload_smbtytp7/ansible_ansible.posix.acl_payload.zip/ansible/module_utils/common/process.py", line 64, in get_bin_path
    raise ValueError('Failed to find required executable "%s" in paths: %s' % (arg, os.pathsep.join(paths)))
failed: [nas] (item={'name': 'tank/a', 'descendents_only': True, 'nas_user': 'user', 'user': 'user', 'perms': ['create', 'share', 'sharenfs', 'mount', 'snapshot'], 'create_time_only_perms': ['destroy']}) => {
    "ansible_loop_var": "item",
    "changed": false,
    "invocation": {
        "module_args": {
            "default": false,
            "entity": "user",
            "entry": null,
            "etype": "user",
            "follow": true,
            "path": "/tank/a",
            "permissions": "aD",
            "recalculate_mask": "default",
            "recursive": false,
            "state": "present",
            "use_nfsv4_acls": true
        }
    },
    "item": {
        "create_time_only_perms": [
            "destroy"
        ],
        "descendents_only": true,
        "name": "tank/a",
        "nas_user": "user",
        "perms": [
            "create",
            "share",
            "sharenfs",
            "mount",
            "snapshot"
        ],
        "user": "user"
    },
    "msg": "Failed to find required executable \"nfs4_setfacl\" in paths: /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载