Fail-Json-obj$result-message"Chocolatey package '$package' is already installed at version '$package_version' but was expecting '$version'. Either change the expected version, set state=latest, set allow_multiple_versions=yes, or set force=yes to continue"
Fail-Json-obj$result-message"Chocolatey package '$package' is already installed at version '$package_version' but was expecting '$version'. Either change the expected version, set state=latest, or set force=yes to continue"
- name:raise failure when state=present and name=all
win_chocolatey:
name:all
state:present
register:fail_all_present
failed_when:fail_all_present.msg != "Cannot specify the package name as 'all' when state=present"
- name:raise failure when state=reinstalled and name=all
win_chocolatey:
name:all
state:reinstalled
register:fail_all_reinstalled
failed_when:fail_all_reinstalled.msg != "Cannot specify the package name as 'all' when state=reinstalled"
- name:install package (check mode)
win_chocolatey:
name:'{{ test_choco_package1 }}'
@ -256,7 +270,7 @@
state:present
version:0.1.0
register:fail_multiple_versions
failed_when:fail_multiple_versions.msg != "Chocolatey package '" + test_choco_package1 + "' is already installed at version '0.0.1' but was expecting '0.1.0'. Either change the expected version, set state=latest, set allow_multiple_versions=yes, or set force=yes to continue"
failed_when:fail_multiple_versions.msg != "Chocolatey package '" + test_choco_package1 + "' is already installed at version '0.0.1' but was expecting '0.1.0'. Either change the expected version, set state=latest, or set force=yes to continue"