Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'with_community.general.filetree' is not a valid attribute for a Task #4304

Open
4wk- opened this issue Aug 28, 2024 · 3 comments
Open

'with_community.general.filetree' is not a valid attribute for a Task #4304

4wk- opened this issue Aug 28, 2024 · 3 comments
Labels

Comments

@4wk-
Copy link

4wk- commented Aug 28, 2024

SUMMARY

ansible-lint is complaining about attribute with_community.general.filetree not being valid. However, it's in Ansible official documentation. cf examples.

image

Am I missing something?

ISSUE TYPE
  • Bug Report
OS / ENVIRONMENT

Debian 12.6 in wsl2

$ ansible-lint --version
ansible-lint 24.7.0 using ansible-core:2.17.2 ansible-compat:24.7.0 ruamel-yaml:0.18.6 ruamel-yaml-clib:0.2.8
  • ansible installation method: pipx
  • ansible-lint installation method: pipx
STEPS TO REPRODUCE
---
- name: testing123
  hosts: all
  become: yes
  gather_facts: no
  tasks:

    - name: Testing filetree
      ansible.builtin.template:
        src: "{{ item.path }}"
        dest: "/tmp/"
        owner: root
        group: root
        mode: '644'
      with_community.general.filetree: "templates/"
      when: item.state == 'file'
DESIRED BEHAVIOR

ansible-lint should not complain about with_community.general.filetree.

ACTUAL BEHAVIOR
$ ansible-lint zplay.yml
WARNING  Listing 1 violation(s) that are fatal
syntax-check[specific]: 'with_community.general.filetree' is not a valid attribute for a Task
zplay.yml:11:7


                  Rule Violation Summary
 count tag                    profile rule associated tags
     1 syntax-check[specific] min     core, unskippable

Failed: 1 failure(s), 0 warning(s) on 1 files. Profile 'production' was required.
@4wk- 4wk- added bug new Triage required labels Aug 28, 2024
@audgirka audgirka removed the new Triage required label Sep 18, 2024
@cavcrosby
Copy link
Contributor

I was able to reproduce this when deleting the community.general collection from all directories within Ansible's collections_path. Can you check to see if the collection is installed, and that the collections_path configuration is set appropriately to find the collection?

@leonardgerardatomicmachinescom

Is the linter dependent on the specific ansible that is installed in the system? (we run the linter in CI, which doesn't install ansible)

@cavcrosby
Copy link
Contributor

@leonardgerardatomicmachinescom I believe ansible-lint will work with versions of ansible/ ansible-core that meet the version constraint ansible-core>=2.13.0. I'm basing this on the "requirements.txt" file used to specify runtime dependencies, as shown below.

ansible-core>=2.13.0 # GPLv3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

No branches or pull requests

4 participants