chocolatey / chocolatey-ansible

The Chocolatey module collection for Ansible
GNU General Public License v3.0
49 stars 30 forks source link

win_chocolatey - Deprecate `allow_multiple` option #109

Closed vexx32 closed 1 year ago

vexx32 commented 1 year ago

Description Of Changes

Motivation and Context

See #94

Testing

Make a new playbook.yml file in the build/vagrant-files directory with the following content:

---

- name: Test allow_multiple deprecation warnings
  gather_facts: false
  hosts: all

  tasks:
    - name: Install a package with allow_multiple
      chocolatey.chocolatey.win_chocolatey:
        name: python
        version: 3.9.5
        allow_multiple: yes
        state: present

Follow the instructions in build/README.md and use Start-VagrantEnvironment.ps1 to get the Vagrant environment up and running, and run the above playbook with ansible-playbook.

You should see a prominent deprecation warning displayed like so:

[DEPRECATION WARNING]: Param 'allow_multiple' is deprecated. See the module docs for more information. This feature will be removed from 
chocolatey.chocolatey in version 2.0.0. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.

Operating Systems Testing

N/A

Change Types Made

Change Checklist

Related Issue

Fixes #94

vexx32 commented 1 year ago

Marking as draft, there's some errors I'm noticing in CI that aren't yielding any failed test results. 😕

vexx32 commented 1 year ago

@Windos I've rebased this on the main branch to include the CI fixes, so we should be good to go here as well.

vexx32 commented 1 year ago

@Windos I realised there was one more place we need to put the minimum Ansible version in here in meta/runtime.yml, so I've amended the commit to include this too.

Given the strict requirement here is actually 2.10 for the deprecation support in collections, I've set the absolute minimum there in this file, but as the README states our actual testing will encompass only 2.12 and up.