ansible-collections / community.windows

Windows community collection for Ansible
https://galaxy.ansible.com/community/windows
GNU General Public License v3.0
204 stars 157 forks source link

Add `accept_license` option to `win_psmodule` #411

Closed briantist closed 2 years ago

briantist commented 2 years ago
SUMMARY

Fixes #340

Adds accept_license option to win_psmodule so that modules requiring license acceptance can be installed.

ISSUE TYPE
COMPONENT NAME

win_psmodule

ADDITIONAL INFORMATION

N/A

briantist commented 2 years ago

It turns out the way to use PowerShellGet Format 2.0 is to add a tag with the value of PowerShellGetFormatVersion_2.0 to module 😖 ...cool.

briantist commented 2 years ago

The remaining failures are all galaxy 429 errors. The last commit https://github.com/ansible-collections/community.windows/pull/411/commits/3e79a3c7b8cbeb4b5e6e650b6f66fe50b32a8cc7 only adds a single sentence to a docs description.

The checks on the previous commit https://github.com/ansible-collections/community.windows/pull/411/commits/8db300665dc9efa5642eb0b0ad2f0eafe63864f2 all completed successfully.

jborean93 commented 2 years ago

Looks like -AcceptLicense and other license functionality was added in PowerShellGet 1.5.0 which is below our minimum requirements of 1.6.0. The changes here should be fine as long as someone follows our requirements note.

coreydeli commented 2 years ago

I am not sure that this is working as expected.

"msg": "Problems installing PowerShellGet module: A parameter cannot be found that matches parameter name 'AcceptLicense'.",

is what I am receiving while using

    - name: Install PowerShellGet
      community.windows.win_psmodule:
        name: PowerShellGet
        accept_license: yes
        state: latest
briantist commented 2 years ago

@Iwifia the change has not been released yet as far as I know, you could work around it now with an earlier version of the collection, or by installing from git. This may help: