I get the following error when trying to run dotnet nuget add source of my ADO private repository to a windows target machine:
"stdout": "error: The requested operation cannot be completed. The computer must be trusted for delegation and the current user account must be configured to allow delegation.
The Ansible task is:
- name: Add private NuGut source
win_shell: "dotnet nuget add source https://pkgs.dev.azure.com/XXXX/_packaging/GlobalPackageRegistry/nuget/v3/index.json -n GlobalPackageRegistry -u [email protected] -p {{ token }} --valid-authentication-types basic"
when: ansible_facts['os_family'] == "Windows"
Ansible playbook command:
ansible-playbook -i agents.yml set_nuget.yml --extra-vars "token=ZZZZZZZZZXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
If I run the command with the same user it is logging into in Ansible on the windows target machine, the command runs fine and it is able to create a NuGet.Config file just fine.
used this and it worked: https://jarrodstech.net/fix-the-computer-must-be-trusted-for-delegation-and-the-current-user-account-must-be-configured-to-allow-delegation/