Community.general cant be installed

I am at a loss here. I need to use this task:

            - name: Archive the scratchpad directory into a zip file, move to /dcr_archived | itsm_dcr
              community.general.archive:
                path: "{{ runtime }}{{ scratchpad }}" 
                dest: "{{ scratchpad_archived }}/DCR_archived_{{ currenttime }}.zip"  
                format: zip
                force_archive: true
              ignore_errors: true
              register: archive_dcr_out
              failed_when: not archive_dcr_out.failed
              remote_src: yes 

That errors out:

[ansible_admin@ctrl ansible]$ ansible-playbook ./playbooks/dcr2.yml 
ERROR! conflicting action statements: community.general.archive, remote_src

The error appears to be in '/etc/ansible/playbooks/dcr2.yml': line 140, column 15, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


            - name: Archive the scratchpad directory into a zip file, move to /dcr_archived | itsm_dcr
              ^ here
[ansible_admin@ctrl ansible]$ 

While installing it I get this error:


[ansible_admin@ctrl ansible]$ ansible-galaxy collection install community.general
Starting galaxy collection install process
[WARNING]: Collection community.general does not support Ansible version 2.16.3
Nothing to do. All requested collections are already installed. If you want to reinstall them, consider using `--force`.

Please help.
Thanks.
Nestor.

There is no error with installing community.general, because it’s already installed.

Instead you have an error in your task:

ERROR! conflicting action statements: community.general.archive, remote_src

remote_src is not a valid at the task level, and thus ansible thinks that you are trying to indicate a module called remote_src. Since you’re already mentioning community.general.archive it doesn’t know which one you really mean.

Simply remove the remote_src: yes line.

1 Like

Right again. Thanks.
Nestor.