yandex-cloud / examples

Examples of code, configuration files etc. to be used with Yandex Cloud.
186 stars 132 forks source link

Problems adding package provider: No match was found for the specified search criteria for the provider 'NuGet' #27

Open patsevanton opened 3 years ago

patsevanton commented 3 years ago

ansible --version

ansible 2.6.17

packer build windows-ansible.json

yandex: output will be in this color.

==> yandex: Creating temporary ssh key for instance...
==> yandex: Using as source image: fd85s1nlcavgdpc16hj3 (name: "windows-2016-gvlk-1556619485", family: "windows-2016-gvlk")
==> yandex: Use provided subnet id b0c8pliu8o98kgtui3r3
==> yandex: Creating instance...
==> yandex: Waiting for instance with id ef333e47f9sh2fdfqd0a to become active...
    yandex: Detected instance IP: 178.154.234.144
==> yandex: Using winrm communicator to connect: 178.154.234.144
==> yandex: Waiting for WinRM to become available...
==> yandex: #< CLIXML
    yandex: WinRM connected.
==> yandex: <Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04"><Obj S="progress" RefId="0"><TN RefId="0"><T>System.Management.Automation.PSCustomObject</T><T>System.Object</T></TN><MS><I64 N="SourceId">1</I64><PR N="Record"><AV>Preparing modules for first use.</AV><AI>0</AI><Nil /><PI>-1</PI><PC>-1</PC><T>Completed</T><SR>-1</SR><SD> </SD></PR></MS></Obj><Obj S="progress" RefId="1"><TNRef RefId="0" /><MS><I64 N="SourceId">1</I64><PR N="Record"><AV>Preparing modules for first use.</AV><AI>0</AI><Nil /><PI>-1</PI><PC>-1</PC><T>Completed</T><SR>-1</SR><SD> </SD></PR></MS></Obj></Objs>
==> yandex: Connected to WinRM!
==> yandex: Uploading /home/user/examples/packer-ansible-windows/setup_complete/ => C:\Windows\Setup\Scripts\
==> yandex: Provisioning with Ansible...
    yandex: Setting up proxy adapter for Ansible....
==> yandex: Executing Ansible: ansible-playbook -e packer_build_name="yandex" -e packer_builder_type=yandex --connection=packer --extra-vars ansible_shell_type=powershell ansible_shell_executable=None ansible_python_interpreter=/usr/bin/python -e ansible_ssh_private_key_file=/tmp/ansible-key064885685 -i /tmp/packer-provisioner-ansible611103632 /home/user/examples/packer-ansible-windows/ansible/exmb_prereq.yml
    yandex: /home/user/.local/lib/python2.7/site-packages/ansible/parsing/vault/__init__.py:44: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in a future release.
    yandex:   from cryptography.exceptions import InvalidSignature
    yandex:
    yandex: PLAY [all] *********************************************************************
    yandex:
    yandex: TASK [Gathering Facts] *********************************************************
    yandex: ok: [default]
    yandex:
    yandex: TASK [download required modules] ***********************************************
    yandex: failed: [default] (item=xActiveDirectory) => {"changed": false, "item": "xActiveDirectory", "msg": "Problems adding package provider: No match was found for the specified search criteria for the provider 'NuGet'. The package provider requires 'PackageManagement' and 'Provider' tags. Please check if the specified package has the tags.", "nuget_changed": false, "output": "", "repository_changed": false}
    yandex: failed: [default] (item=xExchange) => {"changed": false, "item": "xExchange", "msg": "Problems adding package provider: No match was found for the specified search criteria for the provider 'NuGet'. The package provider requires 'PackageManagement' and 'Provider' tags. Please check if the specified package has the tags.", "nuget_changed": false, "output": "", "repository_changed": false}
    yandex: failed: [default] (item=xPSDesiredStateConfiguration) => {"changed": false, "item": "xPSDesiredStateConfiguration", "msg": "Problems adding package provider: No match was found for the specified search criteria for the provider 'NuGet'. The package provider requires 'PackageManagement' and 'Provider' tags. Please check if the specified package has the tags.", "nuget_changed": false, "output": "", "repository_changed": false}
    yandex: failed: [default] (item=NetworkingDsc) => {"changed": false, "item": "NetworkingDsc", "msg": "Problems adding package provider: No match was found for the specified search criteria for the provider 'NuGet'. The package provider requires 'PackageManagement' and 'Provider' tags. Please check if the specified package has the tags.", "nuget_changed": false, "output": "", "repository_changed": false}
    yandex: failed: [default] (item=ComputerManagementDsc) => {"changed": false, "item": "ComputerManagementDsc", "msg": "Problems adding package provider: No match was found for the specified search criteria for the provider 'NuGet'. The package provider requires 'PackageManagement' and 'Provider' tags. Please check if the specified package has the tags.", "nuget_changed": false, "output": "", "repository_changed": false}
    yandex: failed: [default] (item=StorageDsc) => {"changed": false, "item": "StorageDsc", "msg": "Problems adding package provider: No match was found for the specified search criteria for the provider 'NuGet'. The package provider requires 'PackageManagement' and 'Provider' tags. Please check if the specified package has the tags.", "nuget_changed": false, "output": "", "repository_changed": false}
    yandex:     to retry, use: --limit @/home/user/examples/packer-ansible-windows/ansible/exmb_prereq.retry
    yandex:
    yandex: PLAY RECAP *********************************************************************
    yandex: default                    : ok=1    changed=0    unreachable=0    failed=1
    yandex:
==> yandex: Provisioning step had errors: Running the cleanup provisioner, if present...
==> yandex: Destroying instance...
    yandex: Instance has been destroyed!
==> yandex: Destroying boot disk...
    yandex: Disk has been deleted!
Build 'yandex' errored after 7 minutes 57 seconds: Error executing Ansible: Non-zero exit status: exit status 2
patsevanton commented 3 years ago

ansible 2.8.16: yandex: fatal: [default]: FAILED! => {"ansible_facts": {}, "changed": false, "failed_modules": {"setup": {"failed": true, "module_stderr": "Warning: Permanently added '[127.0.0.1]:54697' (RSA) to the list of known hosts.\r\nParameter format not correct - ;\r\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}}, "msg": "The following modules failed to execute: setup\n"}

patsevanton commented 3 years ago

ansible 2.9.14: yandex: fatal: [default]: FAILED! => {"ansible_facts": {}, "changed": false, "failed_modules": {"setup": {"failed": true, "module_stderr": "Warning: Permanently added '[127.0.0.1]:55088' (RSA) to the list of known hosts.\r\nParameter format not correct - ;\r\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}}, "msg": "The following modules failed to execute: setup\n"}

patsevanton commented 3 years ago

ansible 2.5.15: yandex: fatal: [default]: FAILED! => {"changed": false, "module_stderr": "The filename, directory name, or volume label syntax is incorrect.\r\n#< CLIXML\r\n<Objs Version=\"1.1.0.1\" xmlns=\"http://schemas.microsoft.com/powershell/2004/04\"><Obj S=\"progress\" RefId=\"0\"><TN RefId=\"0\"><T>System.Management.Automation.PSCustomObject</T><T>System.Object</T></TN><MS><I64 N=\"SourceId\">1</I64><PR N=\"Record\"><AV>Preparing modules for first use.</AV><AI>0</AI><Nil /><PI>-1</PI><PC>-1</PC><T>Completed</T><SR>-1</SR><SD> </SD></PR></MS></Obj><S S=\"Error\">invalid payload_x000D__x000A_</S><S S=\"Error\">At line:4 char:39_x000D__x000A_</S><S S=\"Error\">+ If (-not $split_parts.Length -eq 2) { throw \"invalid payload\" }_x000D__x000A_</S><S S=\"Error\">+ ~~~~~~~~~~~~~~~~~~~~~~~_x000D__x000A_</S><S S=\"Error\"> + CategoryInfo : OperationStopped: (invalid payload:String) [], RuntimeException_x000D__x000A_</S><S S=\"Error\"> + FullyQualifiedErrorId : invalid payload_x000D__x000A_</S><S S=\"Error\"> _x000D__x000A_</S></Objs>Connection to 127.0.0.1 closed.\r\n", "module_stdout": "", "msg": "MODULE FAILURE", "rc": 1}

patsevanton commented 2 years ago

Не помогает

    - name: Set strong cryptography on 64 bit .Net Framework (version 4 and above)
      become: yes
      become_user: Administrator
      ansible.windows.win_shell: |
        Set-ItemProperty -Path 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NetFramework\v4.0.30319' -Name 'SchUseStrongCrypto' -Value '1' -Type DWord
      register: set_strong_cryptography

    - debug: var=set_strong_cryptography.stdout_lines

    - name: Force PowerShell to use TLS 1.2
      become: yes
      become_user: Administrator
      ansible.windows.win_shell: |
        [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
      register: force_powershell_use_tls

    - debug: var=force_powershell_use_tls.stdout_lines
patsevanton commented 2 years ago

Try run provisioners powershell before provisioners ansible.

Don`t work.

  "provisioners": [
    {
      "type": "powershell",
      "inline": [
          "Set-ItemProperty -Path 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NetFramework\v4.0.30319' -Name 'SchUseStrongCrypto' -Value '1' -Type DWord",
          "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12"
      ]
    }
  ]