DebugFactor.com | Forum

Ansible win_unzip: PowershellCommunityExtensions Powershell Module (PSCX) is required for non-'zip' compressed archieve type

I am using win_unzip to unzip files in Ansible. Below is the code.

win_unzip:
 src: "{{zip_location}}"
 dest: "{{dest_location}}"
 recurse: true

When I run the playbook, I get the below error:

fatal: {
msg: : "PowershellCommunityExtensions POwershell Module (PSCX) is required for non-'zip' compressed archieve type."
}

Can you please advise?

Thanks in Advance.

You need to remove the recurse: true attribute. As per the ansible documentation
"Recurse - Setting to a value of yes requires the PSCX module to be installed." Please try as below.

win_unzip:
 src: "{{zip_location}}"
 dest: "{{dest_location}}"

Incase you still want to use it make sure you install PSCX module manually or via ansible as below.

- name: Install PSCX module
  win_psmodule:
    name: Pscx
    state: present