Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chocolatey playbook fix post-#1735 #1807

Closed
rwxford opened this issue Sep 15, 2022 · 0 comments · Fixed by #1915
Closed

Chocolatey playbook fix post-#1735 #1807

rwxford opened this issue Sep 15, 2022 · 0 comments · Fixed by #1915
Assignees

Comments

@rwxford
Copy link

rwxford commented Sep 15, 2022

Area

Ansible Windows Automation Workshop

Proposed Changes

#1735fixed the missing variables. See https://aap2.demoredhat.com/exercises/ansible_windows/8-chocolatey/
However, when running the fixed version, I receive:

Identity added: /runner/artifacts/11/ssh_key_data (/runner/artifacts/11/ssh_key_data)
PLAY [Install Specific versions of packages using Chocolatey] ******************
TASK [Install specific versions of packages sequentially] **********************
failed: [student1-win1] (item={'name': 'nodejs', 'version': '13.0.0'}) => {"ansible_loop_var": "item", "changed": false, "command": "", "item": {"name": "nodejs", "version": "13.0.0"}, "msg": "Chocolatey package 'nodejs' is already installed with version(s) '' but was expecting '13.0.0'. Either change the expected version, set state=latest or state=upgrade, set allow_multiple=es, or set force=yes to continue", "rc": 0}
failed: [student1-win1] (item={'name': 'python', 'version': '3.6.0'}) => {"ansible_loop_var": "item", "changed": false, "command": "", "item": {"name": "python", "version": "3.6.0"}, "msg": "Chocolatey package 'python' is already installed with version(s) '' but was expecting '3.6.0'. Either change the expected version, set state=latest or state=upgrade, set allow_multiple=yes, or set force=yes to continue", "rc": 0}
PLAY RECAP *********************************************************************
student1-win1 : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0

I had to add force: yes to ensure completion:

  • name: Install specific versions of packages sequentially
    chocolatey.chocolatey.win_chocolatey:
    force: yes
    name: "{{ item.name }}"
    version: "{{ item.version }}"
    loop: "{{ choco_packages }}"
@cloin cloin self-assigned this Jan 26, 2023
cloin added a commit to cloin/ansible-workshops that referenced this issue Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants